new2this2002
Programmer
I am trying to get java to communicate with my mysql server but i am having problems with the latest version of the mysql jdbc driver connector/j 3.1.0-alpha. Here is my setup
I am using win2k pro, j2sdk1.4.2 and mysql 4.1. My mysql database has the following databases...
mysql
test
testdb
if i run the following java code.....
Class.forName(com.mysql.jdbc.Driver).newInstance();
String dbURL = "jdbc:mysql://localhost:3306/testdb";
java.sql.Connection conn = DriverManager.getConnection(dbURL,"root","rootPassword"
System.out.println("Connected"
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Employees"
conn.close();
System.out.println("Closed"
I get an error saying that the table employees does not exist in the table 'test'. This is correct but the database i specified to connect to was 'testdb'. So for some reason the database name specified as part of the jdbc url is being truncated.
If i try the same code using connector/j 3.0.8-stable i get no errors. The same problem occurs when specifying the 'mysql' database.
Does anyone have any thoughts as to why this may be happening.
I am using win2k pro, j2sdk1.4.2 and mysql 4.1. My mysql database has the following databases...
mysql
test
testdb
if i run the following java code.....
Class.forName(com.mysql.jdbc.Driver).newInstance();
String dbURL = "jdbc:mysql://localhost:3306/testdb";
java.sql.Connection conn = DriverManager.getConnection(dbURL,"root","rootPassword"
System.out.println("Connected"
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT * FROM Employees"
conn.close();
System.out.println("Closed"
I get an error saying that the table employees does not exist in the table 'test'. This is correct but the database i specified to connect to was 'testdb'. So for some reason the database name specified as part of the jdbc url is being truncated.
If i try the same code using connector/j 3.0.8-stable i get no errors. The same problem occurs when specifying the 'mysql' database.
Does anyone have any thoughts as to why this may be happening.