Connecting DataBase to Netbeans IDE
Netbeans is an IDE -a JavA editor provided by Sun Microsystem and it is open source (absolutely free!!)
From last few days i was having problem in my JDBC programming while connecting the ORACLE server to the Netbeans. But finally i have solved it by the help of my senior. But when i was surfing the solution on the internet,it is almost very difficult to search it on Google..and found some forums where where the same problem was discussed but no one tells the appropriate answer..
so i thought i should help my friends
.
Generally in java we use only two database Oracle and Mysql,both vendor provides the jar files which contains classes for the jdbc-driver.I m going to describe both connectivity one by one .
ORACLE DATABASE

ORACLE DATABASE is very easy to install . I think you have already installed it i m just going to explain it’s connectivity with Netbeans
- First run the Netbeans IDE .and open the Service window..
- In service window click on Database expand it and the right click on the Driver ,then add new driver. It will demand for jar file .which is oracle14.jar browse it from C:\oraclexe\app\oracle\product\10.2.0\server\jdbc\lib\oracle14.jar
- Then right click on the database and then Add new connection it will pop-up a new window like below.:)
- You can fill the text boxes like shown in image or go to direct URL and paste this url jdbc:oracle:thin:@//localhost:1521/XE
- now click next and and then select the schema .. then OK. Now u will find a new driver by expanding the database. you simply right click on the driver and click connect ,it will ask for the password of the database then you can execute your sql command on the netbeans like this :
- Now it’s time for some jdbc programming , first to use sql queries in your programming you have to import oracle jdbc library to you library folder for this just Right click on the project library folder and then Add new Library, the oracle library will be not there you have to create it
- And to connect it from your program you have to put “jdbc:oracle:thin:@//localhost:1521/XE”; as your URL and “oracle.jdbc.OracleDriver” as your driver it’s simple
Now your Netbeans is ready Oracle Database Programming with JAVA
My SQL DATABASE

Now it’s turn for MySql database . it’s very simple to install and many of the student who learns database connectivity opt mysql as their database..is’t connectivity with Netbeans is very simple just few steps
- You don’t have to add new driver here ,it is provided by Netbeans.
- You can fill the boxes ,as shown in figure
- Now for JDBC programming you to Add mysql jdbc library to your library folder of your project for this just go to library right click on this and then Add new library .
here you will find Mysql-jdbc library as netbeans provide it just add it and then ok
- Now in your program you have to use “jdbc:mysql://localhost:3306/dbforplacement”(“dbforplacement” is my database name) as the URL of the Database and “com.mysql.jdbc.Driver” as driver..
Now you are ready with MySql database server connected with Netbeans IDE to learn database programming in JAVA
you can comment below for your Queries..
Related posts
Tags: java prgramming, Jdbc programming, Netbeans tutorial, Oracle/sun developmet










July 8th, 2010 at 2:42 pm
gr8 effort keep it up………..
[Reply]
July 11th, 2010 at 3:27 pm
I followed your instructions and it worked great! thanks!
[Reply]
vibhu Reply:
July 14th, 2010 at 8:00 am
[Reply]
July 12th, 2010 at 12:53 pm
Valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up
[Reply]
July 14th, 2010 at 12:02 am
Hello This is a great blog keep your good work and thank you for hvar in with me So nice to hear frome you.Thanks!
[Reply]
vibhu Reply:
July 14th, 2010 at 8:02 am
thanx for appreciating
[Reply]
July 14th, 2010 at 1:53 am
I want to quote your post in my blog. It can?
And you et an account on Twitter?
[Reply]
vibhu Reply:
July 14th, 2010 at 8:03 am
yes it is http://twitter.com/vibhuaddicted
[Reply]
July 16th, 2010 at 5:41 pm
My cousin recommended this blog and she was totally right keep up the fantastic work!
[Reply]
July 21st, 2010 at 4:14 am
Such a well written post.. Thnkx for sharing this post!
[Reply]
July 21st, 2010 at 6:20 pm
Dear admin, thnx for sharing this blog post. I found it wonderful. Best regards, Victoria…
[Reply]
July 22nd, 2010 at 6:48 am
I cannot believe this will work!
[Reply]
July 23rd, 2010 at 3:27 am
this post is very usefull thx!
[Reply]
July 23rd, 2010 at 5:13 am
Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this.
[Reply]
July 25th, 2010 at 12:50 pm
This guided me to complete my work with fun
[Reply]
July 27th, 2010 at 4:50 am
hey all, Keep up the good work. very informative, and love all the information provided. I love everything i have read so far
[Reply]
July 29th, 2010 at 1:14 am
I just needed to say that I found your blog via Goolge and I am glad I did. Keep up the good work and I will make sure to bookmark you for when I have more free time away from the books. Thanks again!
[Reply]
July 29th, 2010 at 11:51 am
somehow found your blog while searching for a article for a class, but I have to say I’m happy I found it …will definately browse more sometime.
[Reply]
July 30th, 2010 at 9:06 pm
It\\\’s great right here. nice study. I\\\’ve been searched this advice for a little bit. thanks
[Reply]
August 3rd, 2010 at 9:26 am
I would like to exchange links with your site magicalharsh.com
Is this possible?
[Reply]
August 4th, 2010 at 9:06 am
Very neat blog article.Really thank you! Want more.
[Reply]
August 23rd, 2010 at 7:47 pm
Re: Oracle 10g connecting to IDE, I found the solution for my sql exception. I needed to include the jar in the Project library.
[Reply]
August 23rd, 2010 at 8:02 pm
My problem is solved, I needed to add the driver jar file to the project library.
[Reply]