| Bug #16667 | i tried to connect using jdbc/j connector 3.1.12 for my sql 5x | ||
|---|---|---|---|
| Submitted: | 20 Jan 2006 11:22 | Modified: | 20 Jan 2006 12:29 |
| Reporter: | prathap athikari | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | Connector / J | Severity: | S2 (Serious) |
| Version: | OS: | Windows (win xp) | |
| Assigned to: | CPU Architecture: | Any | |
[20 Jan 2006 12:29]
Aleksey Kishkin
Prathap, I assume you used a lot of (((( and )))) just for quote some important parts of bug report, and you dont have ((((( in your sources... Well, actualy it's not mysql error, but java message. Could you please consider to ask java questions in the java forums? some notes for checking: 1)Did you compile your program? 2) Did you set mysql connector into the classpath?

Description: i tried to connect but the code i used to check the driover(jdbc) was showing a error(((((((((((((((Exception in thread "main" java.lang.NoClassDefFoundError: TestMysql Press any key to continue . . .))))))))))))))))))))))))and i have also installed the driver which is the jar file in to jdk 1.5.0 lib file the example code which i tried to run isimport java.sql.*; ((((((((((((((((((((((((((((public class TestMysql { public static void main(String args[]) { try { /* Test loading driver */ String driver = "com.mysql.jdbc.Driver"; System.out.println( "=> loading driver:" ); Class.forName( driver ).newInstance(); System.out.println( "OK" ); /* Test the connection */ String url = "jdbc:mysql://localhost/test"; System.out.println( "=> connecting:" ); DriverManager.getConnection( url, "", "" ); System.out.println( "OK" ); } catch( SQLException x ) { System.out.println("SQLException: " + x.getMessage()); System.out.println("SQLState: " + x.getSQLState()); System.out.println("VendorError: " + x.getErrorCode()); } catch ( Exception x ) { System.out.println ("ERROR !!!"); x.printStackTrace(); } } }))))))))))))))))))))))))))))))))))))))))))))))))) can some one help me out. How to repeat: i tried all the ways still i cant gety the connectiviety Suggested fix: please suggest a fix