I've managed to get mysql up and running again (I don't know how) but JDBC won't connect to it.

Here's my little simple code:
------------------------------------------------
import java.sql.*;
import java.io.*;

public class MySQLTester {
        
        public static void main(String[] args) throws Exception {
                Class.forName("com.mysql.jdbc.Driver");
                System.out.println("Loaded Driver...");

DriverManager.setLogWriter(new PrintWriter(System.out));


Connection con = DriverManager.getConnection("jdbc:mysql://localhost/test","tobryan1", "aoeuidhtns");
System.out.println("Got connection...");


Statement s = con.createStatement();
s.executeUpdate("CREATE TABLE students (login char(8), last VARCHAR(20), first VARCHAR(20), " +
"nickname VARCHAR(20), course CHAR(4), period INT)");
}
}
------------------------
And here's what happens:


[iBook:18]> java MySQLTester
Loaded Driver...
DriverManager.getConnection("jdbc:mysql://localhost/test")
trying driver[className=com.mysql.jdbc.Driver,[EMAIL PROTECTED]


and it hangs forever.

-------------------------
I can connect to mysql using the same user name and password, however....


[iBook:20]> mysql -u tobryan1 -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 9 to server version: 4.0.12-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use test;
Database changed
mysql> show tables;
Empty set (0.00 sec)

mysql>
-------------------------
I've searched for info on troubleshooting the JDBC connection and skimmed the O'Reilly book by George Reese, but to no avail.


Should I just give up, or is there something I can do to figure out what's going wrong?

Thanks,
Todd


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to