aspose file tools*
The moose likes JDBC and the fly likes Strange JDBC problem with 'no suitable driver found' Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Strange JDBC problem with Watch "Strange JDBC problem with New topic
Author

Strange JDBC problem with 'no suitable driver found'

Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 145

Hey!

I wrote a method to connect to my MySQL database, and tested it remotely and for a local database. The code looks like this:



Thus far, it has worked fine for me on every machine. Because of this, I copied this over to group project I'm currently working on. Still works fine - but only for me. Two other members of the group get the following exception:



If they add


above the conn = ... statement, it works fine for them, but stops working for me. I get the following exception:



We use the latest version of Connector/J, and it is in our libraries directory.

Does anyone have an idea what the problem might be, or, better yet, how to fix it?


Life is full of choices. Sometimes you make the good ones, and sometimes you have to kill all the witnesses.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19695
    
  20

Your Java code is fine. You just don't have a MySQL database server running on your own machine, or at least not on port 3306.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 145

But I tested both versions of the code about 20 seconds apart - the first one connects, the second doesn't. So the database is running.
The other guys can connect just fine to their local databases (and my remote one), with their altered code, while I just can't.
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

I think, the max user connection allowed is set to 1. Can you check the server connection property ?


Thanks,
Tushar (SCJP 1.5)
Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 145

T Mishra wrote:I think, the max user connection allowed is set to 1. Can you check the server connection property ?


I checked, it's set to 6.
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

lets try this. Are the hostnames and users registered on the mysql server ?
Jan Hoppmann
Ranch Hand

Joined: Jul 19, 2010
Posts: 145

T Mishra wrote:lets try this. Are the hostnames and users registered on the mysql server ?


Ah, that might've been it. Don't know how I could overlook that... thank you!
(Years of working with MySQL, and something as small as this gets me now? Wow.)
T Mishra
Ranch Hand

Joined: Apr 04, 2006
Posts: 108

Never mind, a few months back I wrote an incorrect jdbc url. And I was wondering why ain't the hibernate tool is able to generate pojos.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Strange JDBC problem with 'no suitable driver found'