Saturday, March 5, 2011

Java - Database connectivity My SQL

public Connection getConnection() {
       Connection con=null;
       try {
              Class.forName("com.mysql.jdbc.Driver");
              con = DriverManager.getConnection(
              "jdbc:mysql://127.0.0.1/databaseName","userName","password");
       } catch(Exception e) {
              System.out.println(e);
       }
       return con;
}

0 comments:

Post a Comment

Contact Form

Name

Email *

Message *

The Insane Techie - Android App

Launched an android app for the blog on 07th June 2016. Get it from google play store... Tips for using the app Use in landscape mo...