Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how i can create a datasource from a JDBC connection url in my java code?

 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you for reading my post.
i need to create a Datasource in my java code from connection url that i have.

can some one give me some help about this?

Thanks
 
Eric C Lee
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
DataSources is a concept for in-container application to get a database connection via JNDI look up in the InitialContext.



You can not obtain a DataSource object from a Connection.

Good Luck
 
raminaa niilian
Ranch Hand
Posts: 551
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
thank you reply
Indeed i should create a datasource to pass it to some data provider class and i can not use application server datasource mechanism.


thanks.
 
Jan Cumps
Bartender
Posts: 2586
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at the Database connection pooling services library.

It allows you to create a DataSource object for your database.

It's the same technology as used in Tomcat.
It allows you to do database pooling outside a container or apps server. You can use it in your java application.

It's not difficult to use and configure.

Regards, Jan
[ February 23, 2007: Message edited by: Jan Cumps ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic