• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

mysql error

 
Keith Lockey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
driver.acceptsURL is false, why? I can't get it to connect.
Thanks,
Keith

[ July 22, 2003: Message edited by: Keith Lockey ]
[ July 22, 2003: Message edited by: Keith Lockey ]
 
Keith Lockey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When I try to use the DriverManager, i get "Driver not found for URL: "
Not sure what to do at this point.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to explicitly register the driver.
It seems that using a url String won't work. You need to send a url, a comma, a string, another comma, and another string.
[ July 23, 2003: Message edited by: Marilyn de Queiroz ]
 
Ron Newman
Ranch Hand
Posts: 1056
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are missing the question mark ("?") between the URL and its parameters.
Try changing that line to:
url = url+ "?user="+user+"&password="+passwd;
 
Keith Lockey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,
I have the question mark in my code and it still doesnt work. I have also tried conn=DriverManager.getConnection(url,user,passwd);
That doesn't work either.
Thanks for the help.
Keith
 
Lu Battist
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check your classpath and be sure the mysql driver is on it.
 
Keith Lockey
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my class path is correct, Class.forName("com.mysql.jdbc.Driver").newInstance();
is working properly.
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try following the instructions on this page. You can verify the mySQL set up via the command line before you translate it into Java.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic