Thursday, September 18, 2008
Database connectivity using MySQL with JDBC Driver.
The Code Goes Like This :
Class.forName("org.gjt.mm.mysql.Driver").newInstance(); // " "---> JDBC driver
location
Connection con = DriverManager.getConnection( "jdbc:mysql://localhost:3306
/contacts/", props); // " " --> database file location and name
Statement stmt = con.createStatement();
String query = ... // define query
stmt.executeQuery(query);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment