How to Connect Oracle with Java

Hello Friends, Here is the article to give simple code to connecting Oracle Database with Java Application.Here i am using eclipse IDE. i am connecting java with oracle database using JDBC driver. Let’s see all important steps.

1.First Download jdbc driver. write in google search-box “jdbc driver for oracle”. Download suitable driver and extract.

2.Open your favorite IDE, i am using eclipse.right click on project.scroll down to “Add External JARs”.select the jar file that you downloaded.

3.Write below codes.

4.the above code explanation. server name “localhost”,port number “1521”,SID “orcl” user name “HR” password “hr”. Employees “Table Name”. first_name and last_name are columns. In the codes i am using try and catch. if any exception
occurs then it handle by catch block.

Happy Coding…Thanks.

Post Author: adama