This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

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
 
Ranch Foreman
Posts: 1055
24
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)


 
Bartender
Posts: 20098
101
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
 
Today you are you, that is turer than true. There is no one alive who is youer than you! - Seuss. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!