This week's book giveaway is in the Artificial Intelligence and Machine Learning forum.
We're giving away four copies of Transfer Learning for Natural Language Processing (MEAP) and have Paul Azunre on-line!
See this thread for details.
Win a copy of Transfer Learning for Natural Language Processing (MEAP) this week in the Artificial Intelligence and Machine Learning 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
  • Tim Cooke
  • Paul Clapham
  • Devaka Cooray
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Liutauras Vilda
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Piet Souris
Bartenders:
  • salvin francis
  • Carey Brown
  • Frits Walraven

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: 157
14
  • 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: 68917
275
  • 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: 21975
150
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.
 
"To do good, you actually have to do something." -- Yvon Chouinard
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