How do i connect mysql database without dsn?

All,How do i connect Mysql database without dsn using java application?Thanks NS
[108 byte] By [bhaskarga] at [2007-9-19]
# 1

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

gautam_rgva at 2007-7-8 > top of java,Core,Core APIs...
# 2
Why not using an JDBC driver for working with MySQL ? (e.g. at http://mmmysql.sourceforge.net)You don't have to specify an DSN and it would be faster, than using the jdbc-odbc bridge.
fm_jaeschkea at 2007-7-8 > top of java,Core,Core APIs...