JDBC Wrapper Library

Do you remember this???

Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/myDB", "root", "myPass");

Neither me.. 😛 Here is an easy way of controlling your MySQL database over JDBC.

Example: Let’s assume that there is a MySQL table named ‘Student’ as following.

No Name Age

Then you have to call this method like this.

Object obj[] = {"St-001","Steve",25};
try{
  Handle.setData("Student",obj); // This Handle class comes from my wrapper library.
}catch(SQLException ex){
}

Yes.. Forget all about hardcore SQL stuff in your java program. What all you need is this Wrapper Library and you will be able to manipulate your database with few lines of code.

More examples:
If you want to delete Steve from the database, then you have to call this method like this.

Object fields[] = {"Name"};
Object values[] = {"Steve"};
try{
   Handle.deleteData("Student",fields,values); // `Student` is the MySQL table name
}catch(SQLException ex){
}

Yes..!!!! You don’t have to write Queries.. 🙂

Administering your MySQL database would never be easier again..!!!!

This wraps the rough JDBC calls and provide you a smooth way of accessing your databases;

(For more info, see the library documentation.)

Download the complete package from here .

03 comments on “JDBC Wrapper Library

Leave a Reply