• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

No suitable driver found for jdbc connection.

 
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I'm getting error - No suitable driver found for No suitable driver found for jdbc:mysql:thin:@localhost/jdbcdemo



I'm using eclipse. I have "mysql-connector-java-5.1.21.jar" added as referenced libraries.

Database name - jdbcdemo
Table name - students.
 
Bartender
Posts: 1357
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please verify if the connection url you used in the connection string is valid for MySQL. JDBC (4.0 ? not sure if the same applies to previous versions as well) checks if there is a driver accepting a given connection url.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Connection con = DriverManager.getConnection("jdbc:mysql:thin://localhost/jdbcdemo","root","");

No idea what is being done here. I've installed wamp server and created db there. My database name is jdbcdemo.
MySQL version - 5.6.12

profile being used in MySQL : Username - root password -"".
 
Saloon Keeper
Posts: 7585
176
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
+1 on what Claude said - the "thin:" part looks fishy. Where did you get that from?
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I removed "thin". Now its working but I'm super confused.
I gues I mixed syntaxes for OracleDB and Mysql :
Oracle : jdbc: oracle:thin:@localhost:1521:xe
MySQL : jdbc:mysql://localhost/jdbcdemo

I thought "thin" is used for a driver. Why aren't we using that in MySQL syntax ?
 
Tim Moores
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The "thin" part is an Oracle thing; it does not apply to MySQL. Actually, the entire part after the 2nd colon is specific to the driver, so there's a lot of variety.
 
Shubham Semwal
Ranch Hand
Posts: 176
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot @tim and @claude
reply
    Bookmark Topic Watch Topic
  • New Topic