permaculture playing cards*
The moose likes JDBC and the fly likes mysql error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "mysql error" Watch "mysql error" New topic
Author

mysql error

Keith Lockey
Greenhorn

Joined: Jan 18, 2003
Posts: 20
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

Joined: Jan 18, 2003
Posts: 20
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

Joined: Jul 22, 2000
Posts: 9044
    
  10
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 ]

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
You are missing the question mark ("?") between the URL and its parameters.
Try changing that line to:
url = url+ "?user="+user+"&password="+passwd;


Ron Newman - SCJP 1.2 (100%, 7 August 2002)
Keith Lockey
Greenhorn

Joined: Jan 18, 2003
Posts: 20
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

Joined: Feb 17, 2003
Posts: 104
Check your classpath and be sure the mysql driver is on it.
Keith Lockey
Greenhorn

Joined: Jan 18, 2003
Posts: 20
my class path is correct, Class.forName("com.mysql.jdbc.Driver").newInstance();
is working properly.
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
Try following the instructions on this page. You can verify the mySQL set up via the command line before you translate it into Java.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: mysql error
 
Similar Threads
connecting to mysql, with java, on a mac
MySql connection issue
A challenge while formatting date value from the database
SQLException
Passing ResultSet to JSP