Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

Cannot connect to a database, "No suitable driver" error  RSS feed

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I CANNOT connect to a database.

I have Postgresql installed on my machine, and I downloaded and added three different postgresql libraries (jar files) to my build path.  No matter what I try, I still get this error:

java.sql.SQLException: No suitable driver found for jdbc:postgresql//213.182.16.38:5432/tsdb_login
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at pkgMain.UpdateClients.dbConnect(UpdateClients.java:20)
at pkgMain.UpdateClients.updateClients(UpdateClients.java:29)
at pkgMain.UpdateClients.main(UpdateClients.java:60)

Can someone please tell me what I'm doing wrong to get this error?

It fails on this statement.
connLog = DriverManager.getConnection(url, user, pwd);

It is clearly in my build path, see screenshot in the attachment.







fff.jpg
[Thumbnail for fff.jpg]
Screenshot of my configuration
 
Saloon Keeper
Posts: 1111
36
IBM DB2 Java Netbeans IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Instead of

try with

(note the missing : in the original URL string)


 
Saloon Keeper
Posts: 20502
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Punctuation is important!

BTW, here's the official documentation on forms: https://jdbc.postgresql.org/documentation/head/connect.html
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!