For connecting java application with the oracle database, we need to follow the above steps .
Here I am using Oracle10g as the database. So we need to know following information for the oracle database:
Driver class: The driver class for the oracle database is oracle.jdbc.driver.OracleDriver.
Connection URL: The connection URL for the oracle10G database is jdbc:oracle:thin:@localhost:1521:xe where jdbc is the API,oracle is the database, thin is the driver, localhost is the server name on which oracle is running, we may also use IP address, 1521 is the port number and XE is the Oracle service name. You may get all these information from the tnsnames.ora file.
Username: The default username for the oracle database is system.
Password: Password is given by the user at the time of installing the oracle database.
Let's see an example to retrieve all the records of employee table. So we have to first create a table in oracle database, then inserting some records, then writing a jdbc application to retrieve records from oracle database.
create table employee
inserting a record
insert into employee values(101,'Tapuuu',15000);