• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connecting to postgresql

 
Simon Simbolon
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help.

Does anyone knows how to connect Java Apps to PostgreSQL using a class that implements javax.sql.DataSource?
I also needed the class to be able to accept jdbc url (eg. jdbc:postgresql://localhost/mydatabase) as input.
I'm currently working with a legacy system that kinda restrict connection with that condition.

I tried googling but can't seem to find class that support that condition.

Please help?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34396
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simon,
I don't follow. Does the class supplied with the postgresql driver not do that?
 
Simon Simbolon
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for not being clear,

What I meant is that I needed a class in postgresql jdbc, I'm currently using postgresql-9.0-801.jdbc4.jar, that implement javax.sql.DataSource, so that I can get connection with code similar to this:



I've tried googling, but every class I found that implement javax.sql.DataSource, such as org.postgresql.ds.PGSimpleDataSource, can't take url as its input
So, any suggestion?

Thanks in advance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic