Sourceforge MySQL JDBC driver
http://mmmysql.sourceforge.net/
maybe this code frag will be helpful...
String connectionURL = "jdbc:mysql://centauri.sbs:3306/dbname";
Connection conn = null;
Statement statement = null;
ResultSet rset = null;
try {
Class.forName("org.gjt.mm.mysql.Driver").newInstance();
conn = DriverManager.getConnection(connectionURL,"servlet","password");
statement = conn.createStatement(
ResultSet.TYPE_SCROLL_SENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rset = statement.executeQuery(
"SELECT * FROM BROWSER WHERE sessionID='"
+ request.getParameter("session_id") +"'");
.. now use rset
} // try
catch( ClassNotFoundException e ) {
PrintWriter pw = new PrintWriter(out, true);
pw.println("Couldn't find the mm database driver: "
+ e.getMessage());
}
catch( InstantiationException e ) {
PrintWriter pw = new PrintWriter(out, true);
pw.println(e.getMessage());
}
catch( IllegalAccessException e ) {
PrintWriter pw = new PrintWriter(out, true);
pw.println(e.getMessage());
}
catch( SQLException e ) {
PrintWriter pw = new PrintWriter(out, true);
pw.println("SQL Problem: " + e.getMessage());
pw.println("SQL State: " + e.getSQLState());
pw.println("Vendor Error: " + e.getErrorCode());
}
finally {
try {
if ( conn != null )
conn.close();
}
catch( SQLException e ) {
PrintWriter pw = new PrintWriter(out, true);
pw.println(e.getMessage());
}
}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php