Results 1 to 1 of 1
Thread: jsp connection to MySQL
May 29, 2004, 02:38 #1
- Join Date
- Jan 2004
- 0 Post(s)
- 0 Thread(s)
jsp connection to MySQL
Hi there, I 'm trying to connect to MySQL with a jsp scriptlet:
conn = DriverManager.getConnection("jdbc:mysql://localhost/betting?user=root");
Where betting is my database and user root has no password. However I get an exception with the following message:
SQLException: Cannot load connection class because of underlying exception: 'java.lang.NumberFormatException: For input string: "localhost"'.
I can't understand why localhost should be a number? I followed the example by the book from MySQL driver for Java manual. BTW I tried to replace localhost with 127.0.0.1 with the same results. Any ideas?