aspose file tools*
The moose likes JDBC and the fly likes how i can create a datasource from a JDBC connection url in my java code? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how i can create a datasource from a JDBC connection url in my java code?" Watch "how i can create a datasource from a JDBC connection url in my java code?" New topic
Author

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

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 550
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

Joined: Feb 22, 2007
Posts: 4
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

Joined: Jul 14, 2005
Posts: 550
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

Joined: Dec 20, 2006
Posts: 2477
    
    7

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 ]

OCUP UML fundamental and ITIL foundation
youtube channel
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how i can create a datasource from a JDBC connection url in my java code?
 
Similar Threads
connection pooling
How to actually create a Datasource
How to test persistence layer of a web based application?
Getting Database Connection from Servlet
JDBC 2.0 DataSource