Configuring JDBC on Netbeans on Ubuntu 12.04

This is my first, to do, geeky post, hope this should help you all. To start with, I have two systems, a Core i5 desktop running Windows 7 (64 bit) and an Atom Net book running Windows 8 + Ubuntu 12.04. I had been trying Servlet program on my desktop and it worked fine until I had to add database connectivity to it. I had Oracle 10g installed on my desktop but wasn’t able to get the database connected.

But things were working just fine on my net book(Ubuntu) I prefer Ubuntu for programming for the sole reason that setting up things on it is easy and quick ! As we are using Netbeans IDE at our college, I first installed it on Ubuntu. (You can download it from here and choose Linux(x64/x86) version)

Here are some steps to configure JDBC on Netbeans on Ubuntu. Once you download the .sh file, simply open terminal and type the following :

sudo chmod +x netbeans-*
sudo ./netbeans-*

Once done with this, a GUI wizard will start and will guide you for the rest of the setup. Setup again was a breeze and require minimum number of clicks. Once the installation is done, it’s time to configure JDBC.

I’m using the MySQL Database for this. I had been using JDBC in swings previously. Now open NetBeans and create a new Application. Choose Java Web –> Web Application. Now you will see a list of files in the left pane. Right click on your project name –> Properties. Also, to add new files like .html, servlet etc choose New from the same menu.

Right Click Project Name --> Properties
Right Click Project Name –> Properties


Now select Library –> Add Library. Now look for MySQL JDBC Driver. Select that driver and add.

Select MySQL Driver from Add Library menu.
Select MySQL Driver from Add Library menu.

Click OK and run your program. I hope you don’t need the program now ! Below is a screenshot of how records from database will be displayed once the JDBC has been configured.

Sample Servlet Program using JDBC.
Sample Servlet Program using JDBC.

As you saw, this was a very simple task. Once you spend this small amount of time, things will be much simpler. Hope this post helps you !

Happy Coding !

About Atulmaharaj

Maintaining the blog for the past 6 years, I'm a Foodie, Techie, Cricket Enthu, Traveler, Blogger and a Cook ! You'll find posts within a wide range of topics from food to technology. Favorite Quote: "Traveling is like reading a book, one who hasn't traveled, hasn't turned a page.

Check Also

Send Custom Response emails for Google Forms

Google Forms – Detailed guide to send custom response emails

Let me start this post by asking a question, how many of you get link …

Share your thoughts

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Are You Serious ?

You should not leave without signing up for our newsletter !

Get a weekly digest of all the posts from the blog delivered right to your inbox, just a click away, Sign Up Now !
PS: We hate Spam too, We promise, we'll never spam.
Email address
Secure and Spam free...
%d bloggers like this: