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..


















