For connecting java application with the oracle database, you need to follow 5 steps to perform database connectivity:
1)Driver class:The driver class for the oracle database is oracle.jdbc.driver.OracleDriver.
2)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 informations from the tnsnames.ora file.
3)Username:The default username for the oracle database is system.
4)Password:Password is given by the user at the time of installing the oracle database.
Example to Connect Java Application with Oracle database: