6 messages in com.mysql.lists.javaRe: Driver error| From | Sent On | Attachments |
|---|---|---|
| Susidzaimah Pg Sulaiman CS2000 | 10 Feb 2004 03:15 | |
| Ricardo Lopes | 10 Feb 2004 04:33 | |
| Mike Markovich | 10 Feb 2004 08:17 | |
| Susidzaimah Pg Sulaiman CS2000 | 10 Feb 2004 08:31 | |
| Jeff Mathis | 10 Feb 2004 08:36 | |
| Susidzaimah Pg Sulaiman CS2000 | 10 Feb 2004 08:53 |
| Subject: | Re: Driver error![]() |
|---|---|
| From: | Susidzaimah Pg Sulaiman CS2000 (spgs...@cis.strath.ac.uk) |
| Date: | 02/10/2004 08:53:10 AM |
| List: | com.mysql.lists.java |
you need to have two jar files, "mysql-connector-java-3.0.10-stable.jar" and "servlet.jar" in your userlets\servlet_classes folder
and make sure you have set up your classpath correctly for both servlet and mysql JDBC classes
regards susi sulaiman
Jeff Mathis wrote:
"jar thingy"?
thats a new one ....
Susidzaimah Pg Sulaiman CS2000 wrote:
Thank you guys. I got it already.
It is because mysql-connector-java.jar is not available and I haven't set the classpath for mySQL JDBC classes. I'm using Uni's PC so I assume those jar thingy are already available.
thanks again
regards susi sulaiman
Mike Markovich wrote:
Hi Susi,
I think the first occurance of "user" in the statement that starts with DriverManager.getConnection(...is causing your problem. Remove it and you should be fine. Below is what your connect statement should look like, also, you don't appear to be connecting to a database, is this what you want?
Mike
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
DriverManager.getConnection("jdbc:mysql://devweb.cis.strath.ac.uk/" + "?user=" + user + "&password=" + password);
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-----Original Message----- From: Susidzaimah Pg Sulaiman CS2000 [mailto:spgs...@cis.strath.ac.uk] Sent: Tuesday, February 10, 2004 3:16 AM To: Maria Dolores Moral; ja...@lists.mysql.com Subject: Re: Driver error
it seems that the compiler skip anything once it found
+++++++++++++ Class.forName("org.gjt.mm.mysql.Driver").newInstance(); connection = DriverManager.getConnection("jdbc:mysql://devweb.cis.strath.ac.uk/" + user + "?user=" + user + "&password=" + password); +++++++++++++++
in the try statement and goes straight to catch statement. is possible because of my JDBC driver? but I have tested the JDBC driver in a simple java program (not servlet) and it does connect to mySQL database.
regards susi sulaiman
Maria Dolores Moral wrote:
Hi again I don't know very much about mysql, but I think you must especified the port and DB. Print something before the place where you made: connection=DriverManager.getConnection ... System.out.printl("Pass");
If you can see it, try it: connection=DriverManager.getConnection("jdbc:mysql://devweb.cis.strath.ac.uk:3306/<DB>" + user + "?user=" + user + "&password=" + password);




