Codxplore.com

Latest news: New android application Islamic Video has been released. its a free islamic video application for android smartphone. Download now!


Right Click on the libraries  under your projec propertise , now click on the Add jar/folder

now add the mysql-connector-java-5.1.23-bin.jar

now add the following class to your project 

package yourpackagename;

import java.sql.*;

/**
 *
 *
 */
public class DB {

    Connection con = null;
    Statement st = null;
    ResultSet rs = null;
    ResultSetMetaData md = null;
    String dburl = "jdbc:mysql://localhost:3306/addressBook";
    String dbuser = "root";
    String dbpassword = "";

    public DB() {
        try {
            con = DriverManager.getConnection(dburl, dbuser, dbpassword);
            st = con.createStatement();
        } catch (Exception ex) {
            ex.getMessage();
        }
    }
}

Tags :

Views : 643

Subscribe Us


Follow Us