Final Step To Make Your JAVA Address Book

Now that you have created your database, its time to create the JAVA application that will use your database!

 

The Java project consists of 9 classes! You can download the Java Project(Source Codes) from  here.

 

 

 

If you are using Eclipse, just copy the whole folder in the Eclipse Directory. If you are using any other IDE, you will have to copy paste each class manually!

 

 

Each class will have a connection code, that will connect your Java application to your SQL database. It will look like this:

Untitled
Change the password to your SQL account password!
 Set String uName and String uPass as to your SQL username and password! Do this for every class.

There is just one step left now!

 

You need two library files in your java project now! They are very important, without these libraries your Java app can not connect with your SQL database!

Download the libraries from here.

 

After downloading the files, you need to import them in your project. This how you do it(on Eclipse):

  1. Right-click on the project(i.e. your java project name)
  2. click on properties
  3. click on Java Build Path
  4. now click on Add External JARs and add both of the libraries!

 

 

This is how it should look!
This is how it should look!

 

 

Once you have modified all the classes and added all the libraries, your addressbook is good to go!
 
If you face any problems, leave a comment below!
cheers!
  • Master

    Hi Thanks so much for this, i did everything as stated but im having a little problem, when i run the program it doesn’t show the login page it starts with the load contact page.. Any help Please…

    • Farhan

      Are you sure you’re opening the login page class?

  • Master

    Someone Please Help.. :)

  • sujan

    How do I run it? Can you plz explain with steps?

  • Master

    Hi please can the Address book use SQLite database? and how is it going to be configured…. Really need assist Thanks.

    • http://www.academytimes.com/ usman

      Yes! the following queries are helping you to configurations.

      mydatabase.execSQL(“CREATE TABLE IF NOT EXISTS TutorialsPoint(Username VARCHAR,Password VARCHAR);”);
      mydatabase.execSQL(“INSERT INTO TutorialsPoint VALUES(‘admin’,’admin’);”);

      For fetching data use the following:-

      Cursor resultSet = mydatbase.rawQuery(“Select * from TutorialsPoint”,null);
      resultSet.moveToFirst();
      String username = resultSet.getString(1);
      String password = resultSet.getString(2);