By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,694 Members | 1,846 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,694 IT Pros & Developers. It's quick & easy.

Connector/J using JSP not happy???

P: n/a
ab
hi all,

we've installed MySQL on a Windows XP machine, but cannot connect to it
using JSP/Servlet. An error message comes up saying:
java.sql.SQLException: General error, message from server: "Incorrect
database name 'water'"
The database water exists on the server.

Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/water
?user=root&password=");

yes, we've tried different databases and the error persists;
yes, we've tried different users and passwords and the error persists;
yes, we looked at the Connector/J documentation and sintax and it is OK
yes, we used google and search for errors but no luc.

we appreciate time and effort to assist us

thanks in advance

Trajano

P.S.

further information to confirm our environment

typing c:\mysql\bin\msqladmin version
Server version: 4.0.20a-debug
Protocol version 10
Connection: localhost via TCP/IP
TCP port: 3306

typing c:\mysql\bin\mysql -h localhost -u root -p
and
mysql>SHOW DATABASES;
Database
mysql
test
water

Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ab
YES, we found the error,

con =
DriverManager.getConnection("jdbc:mysql://localhost/water?user=root&password
=");
/water?user=root

we cannot have a space between water and ?. an old Wrox book had an example
with a space and looking the Connector/J documentation

thanks for the attention

With kind regards,

Trajano
"ab" <ab*@def.com> wrote in message
news:40***********************@news.optusnet.com.a u...
hi all,

we've installed MySQL on a Windows XP machine, but cannot connect to it
using JSP/Servlet. An error message comes up saying:
java.sql.SQLException: General error, message from server: "Incorrect
database name 'water'"
The database water exists on the server.

Class.forName( "com.mysql.jdbc.Driver" ).newInstance();
con = DriverManager.getConnection("jdbc:mysql://localhost/water
?user=root&password=");

yes, we've tried different databases and the error persists;
yes, we've tried different users and passwords and the error persists;
yes, we looked at the Connector/J documentation and sintax and it is OK
yes, we used google and search for errors but no luc.

we appreciate time and effort to assist us

thanks in advance

Trajano

P.S.

further information to confirm our environment

typing c:\mysql\bin\msqladmin version
Server version: 4.0.20a-debug
Protocol version 10
Connection: localhost via TCP/IP
TCP port: 3306

typing c:\mysql\bin\mysql -h localhost -u root -p
and
mysql>SHOW DATABASES;
Database
mysql
test
water

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.