2 posts in topic
Flat View  Flat View

Posted By:   Mandar_Pohnerkar
Posted On:   Wednesday, June 12, 2002 10:09 PM

I have downloaded -- " mm.mysql.jdbc-1.2c.tar.gz " driver to connect to mysql.
Can anybody give me sample java code to connect to mysql database ?
do i have to put files of mm.mysql driver in jdk folder?
Thanking You


Re: mysql-jdbc

Posted By:   Paul_Hunnisett  
Posted On:   Tuesday, July 9, 2002 03:32 AM

You will need to put the driver jar file on your classpath. A common gotcha is that name resolution doesn't always work - if you get any access problems, then try using an ip address in the connection url

Re: mysql-jdbc

Posted By:   Ken_Kong  
Posted On:   Wednesday, June 12, 2002 11:58 PM

Here is one of the example:

Connection con = DriverManager.getConnection("jdbc:mysql:///databasename", "user", "password");

Make sure that the user has grant priviliges in mysql by using grant syntax.
About | Sitemap | Contact