Exception: Unknown system variable 'character_set_results'
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Serene_Chow
Posted On:   Wednesday, July 21, 2004 09:55 AM

Hi, I recently installed MySQL and JDBC driver into my PC. MySQL is working fine however when I try to connect and access MySQL thru JDBC, it gives me error. The exception occurs at L2, L1: Class.forName("com.mysql.jdbc.Driver").newInstance(); L2: con = DriverManager.getConnection("jdbc:mysql:///test", "username", "password"); Is there anything wrong with my codes? Or is there any settings that I missed out? Has anyone face the same problem before? Please advice. Thanks! Rgds, Serene    More>>

Hi,


I recently installed MySQL and JDBC driver into my PC. MySQL is working fine however when I try to connect and access MySQL thru JDBC, it gives me error. The exception occurs at L2,


			
L1: Class.forName("com.mysql.jdbc.Driver").newInstance();
L2: con = DriverManager.getConnection("jdbc:mysql:///test", "username", "password");



Is there anything wrong with my codes? Or is there any settings that I missed out? Has anyone face the same problem before? Please advice. Thanks!


Rgds,
Serene

   <<Less

Re: Exception: Unknown system variable 'character_set_results'

Posted By:   Simon_Ablett  
Posted On:   Thursday, July 22, 2004 05:17 AM

I use

"jdbc:mysql://hostname/dbase?user=usrName&password=pWord"

For example, given a database called 'test' running locally on the current machine, a user of 'simon', and a password of 'mypass' then I would use.

Connection conn =
DriverManager.getConnection("jdbc:mysql://localhost/test?user=simon&password=mypass");

Regards.
About | Sitemap | Contact