Java Database Connectivity with Oracle
Example to Connect Java Application with Oracle databaseIn this example, we are connecting to an Oracle database and getting data from emp table. Here, system and oracle are the username and password of the Oracle database. The above example will fetch all the records of emp table. To connect java application with the Oracle database ojdbc14.jar file is required to be loaded. Two ways to load the jar file:
1) paste the ojdbc14.jar file in JRE/lib/ext folder:
2) set classpath:
How to set the temporary classpath:
How to set the permanent classpath:Go to environment variable then click on new tab. In variable name write classpath and in variable value paste the path to ojdbc14.jar by appending ojdbc14.jar;.; as C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\ojdbc14.jar;.; To see the slides of seting parmanent path click here Next TopicExample To Connect To The Mysql Database |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India