• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Strange JDBC problem with 'no suitable driver found'

 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Rob Spoor
Sheriff
Pie
Posts: 20512
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, the max user connection allowed is set to 1. Can you check the server connection property ?
 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
lets try this. Are the hostnames and users registered on the mysql server ?
 
Jan Hoppmann
Ranch Hand
Posts: 147
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic