Hassan Schroeder wrote:
Gobi wrote:
MySQL 5.0.15 and Tomcat 5.5.12. However, I cannot seem to get a
connection object from my servlet and for the life of me, I can't figure
out why. Here is what I have done:
and I created the following servlet, TestSQL:
It's possible the two items below are transcription errors --
private Connection conn = null;
try {
if (conn == null) {
Class.forName("com.mysql.jdbc.Driver").newInstance();
connW =
? "conn" != "connW" :-)
DriverManager.getConnection("jdbc:mysql://localhost/hostname", <id>,
Shouldn't the "hostname" above be "databasename"?
However, correcting those two items, your code works fine on my own
(slightly backlevel: TC 5.5.9 + MySQL 4.1.13+Connector/J 3.1.6) dev
system.
Thanks. Actually, I figured it out last night. It was the hostname
when it should have been the database name.
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]