So I'm setting up my new server after my old one had died of a server failure. The only boulder I've hit is the JDBC set up. My server runs a Java program that had originally worked fine with the old server. I'll cut to the chase and show you what the problem is... Here is the stack trace when I try to connect using 127.0.0.1 as well as localhost:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '????????????????' at line 1 com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1049) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593) com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525) com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986) com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140) com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620) com.mysql.jdbc.ConnectionImpl.configureClientCharacterSet(ConnectionImpl.java:1890) com.mysql.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:3523) com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2386)
Quite vague isn't it?
This is the code that I use to connect to the server (which has been working fine on my old server):
Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = java.sql.DriverManager.getConnection("jdbc:mysql://localhost:3306/schema?user=user_name&password=pass_word");
Here is some information about my server: Server is running Debian Squeeze, MySQL is set up fine because phpMyAdmin works perfectly, Java version 1.5.0, JDBC Connector/J version 5.1.14, CLASSPATH has been set to the correct directory, ports properly forwarded 3306.
My last resorts are permissions which I'm not exactly sure how to fix for this criteria. So, for anyone that got a Java server connected to JDBC correctly, what do you think I'm missing? Like I mentioned, this Java server HAS worked on my old server (but that was running Debian Lenny). Thank you!