• 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Driver not found for PostgreSQL using JDBC

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

my programme app.java is below:-

its oputput is below:=
welcome to the world of database
class not loaded
No suitable driver found for jdbc:postgresql//localhost:2345/my_first_databse

however in eclipse i have deployed the required jar file in project, and with same properties i am able connect the database perspective >databasedevelopment>  but i can not use this connection in java programme.

where i am wrong ?
 
Rancher
Posts: 179
15
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need another colon inbetween postgresql and //. It's not a valid connection string without that.
The error message is deceptive - it seems to imply you're missing the driver, when really it's usually a bad connection string that causes this error.
 
Marshal
Posts: 69405
276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I am moving you to our databases forum.
 
Saloon Keeper
Posts: 22107
151
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JDBC URLs are in the form "protocol:driver:host path-and-options". So "jdbc:postgresql://localhost/database". Port 2345 is the default used by the driver, so you only really need it when you are talking to a different port.
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Try Free Java/.NET Libraries for Word Excel PowerPoint and PDF
htttp://www.e-iceblue.com/free-apis.html
    Bookmark Topic Watch Topic
  • New Topic