hi
there are two methods to this, as far as i know u can do it with
using the local mysql drivers and connectusing the dsnless code
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url ="jdbc:odbc:Driver={MySQL ODBC 3.51 Driver}; Server=serverip;"+"Database=databasename";
Connection con = DriverManager.getConnection(url, "username", "password");
but it is not advised to use this as u should have the mysql drivers in the local
system.
the next method is using type4 drivers.
http://www.caucho.com/projects/jdbc-mysql/index.xtp
i hope this will help u
gautam