oracle-database-connection-source-codes GitHub Details, Stars and Alternatives | OpenRepoFinder
petrfaltus / repository
oracle-database-connection-source-codes
Console applications for connection to the Oracle database, how to update rows, how to read the table and how to call the stored function and the stored procedure. Complete example collection including Docker and SQL init. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework and for PHP.
A transparent discovery signal based on current public GitHub metadata.
Recent activity35% weight
10
Community adoption25% weight
2
Maintenance state20% weight
100
License clarity10% weight
0
Project information10% weight
75
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
README preview
Oracle database connection source codes
Small example console source codes how to connect to the Oracle database, how to update rows and how to read the table.
Running under Windows
clone this repository to your computer
install the Oracle database (as a Docker container)
prepare the user, the table and rows in the database
Console applications for a network TCP and UDP socket communication over IPv4 and IPv6. Senders and receivers, complete example collection. Code for Java, for C# built by the .NET Framework, for PHP and for Python.
Console applications for connection to the Microsoft SQL Server, how to update rows, how to read the table and how to call the stored function and the stored procedure. Complete example collection including Docker and SQL init. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework and for PHP.
CONNECT sys AS SYSDBA;
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
User testuser (default password T3stUs3r!)
CONNECT testuser;
ALTER SESSION SET "_ORACLE_SCRIPT"=true;
Connection using SQL Developer
User sys (default password Oradoc_db1)
User testuser (default password T3stUs3r!)
SQL lines for sys
CREATE USER testuser IDENTIFIED BY "T3stUs3r!";
GRANT ALL PRIVILEGES TO testuser;
SQL lines for testuser
CREATE TABLE CARS
(
MANUFACTURER VARCHAR2(40 BYTE) NOT NULL,
MODEL VARCHAR2(50 BYTE) NOT NULL,
DOORS NUMBER(2,0) NOT NULL,
CREATED TIMESTAMP(6) DEFAULT CURRENT_TIMESTAMP,
UPDATED TIMESTAMP(6),
REMARK VARCHAR2(80 BYTE),
ID NUMBER(6,0) GENERATED ALWAYS AS IDENTITY START WITH 1 INCREMENT BY 1 NOT NULL,
PRIMARY KEY (ID)
);
CREATE OR REPLACE TRIGGER CARS_UPDATE
BEFORE UPDATE ON CARS
FOR EACH ROW
BEGIN
:NEW.UPDATED := CURRENT_TIMESTAMP;
END;
INSERT INTO CARS (MANUFACTURER, MODEL, DOORS) VALUES ('Hyundai', 'Veloster', 3);
INSERT INTO CARS (MANUFACTURER, MODEL, DOORS) VALUES ('Skoda', 'Fabia', 5);
INSERT INTO CARS (MANUFACTURER, MODEL, DOORS) VALUES ('Volkswagen', 'Passat', 4);
INSERT INTO CARS (MANUFACTURER, MODEL, DOORS) VALUES ('Ford', 'Saloon', 4);
INSERT INTO CARS (MANUFACTURER, MODEL, DOORS) VALUES ('Ford', 'Focus', 5);
CREATE OR REPLACE PACKAGE CALCULATOR AS
FUNCTION FACTORIAL(N INTEGER) RETURN INTEGER;
PROCEDURE ADD_AND_SUBTRACT(A INTEGER, B INTEGER, X OUT INTEGER, Y OUT INTEGER);
END;
/
CREATE OR REPLACE PACKAGE BODY CALCULATOR AS
FUNCTION FACTORIAL(N INTEGER) RETURN INTEGER IS
RESULT INTEGER := 1;
BEGIN
IF N < 0 THEN
RETURN -1;
END IF;
IF N < 2 THEN
RETURN RESULT;
END IF;
FOR IJK IN 2 .. N LOOP
RESULT := RESULT * IJK;
END LOOP;
RETURN RESULT;
END;
PROCEDURE ADD_AND_SUBTRACT(A INTEGER, B INTEGER, X OUT INTEGER, Y OUT INTEGER) IS
BEGIN
X := A + B;
Y := A - B;
END;
END;
/
optional SQL check lines for testuser
SELECT * FROM CARS;
SELECT COUNT(*) FROM CARS;
SELECT COUNT(*) FROM CARS WHERE ID!=1;
SELECT CALCULATOR.FACTORIAL(2) FROM DUAL;
SELECT CALCULATOR.FACTORIAL(3) FROM DUAL;
SELECT CALCULATOR.FACTORIAL(4) FROM DUAL;
SET serveroutput on;
DECLARE
a INTEGER := 12;
b INTEGER := 5;
x INTEGER;
y INTEGER;
BEGIN
dbms_output.put_line('a = ' || a);
dbms_output.put_line('b = ' || b);
CALCULATOR.ADD_AND_SUBTRACT(a, b, x, y);
dbms_output.put_line('x = ' || x);
dbms_output.put_line('y = ' || y);
END;
/
Console applications for JSON communication with my public available mortgage calculation REST service. Complete example collection. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework, for PHP and for Python.
Console applications for JSON communication with my public available bank account validator and converter REST service. Complete example collection. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework, for PHP and for Python.
Console applications for JSON communication with my public available state, territory, continent and area code REST service. Complete example collection. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework, for PHP and for Python.
Console applications for connection to the MySQL, how to update rows, how to read the table and how to call the stored function and the stored procedure. Complete example collection including Docker and SQL init. Code for Java built by the Maven, for Java built by the Gradle, for C# built by the .NET Framework and for PHP.