File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes DataSource Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "DataSource" Watch "DataSource" New topic


vasu maj
Ranch Hand

Joined: Jul 12, 2001
Posts: 396
I have a need to get a DataSource object to be passed to a method. I am testing it locally using a class with main method and so can not usde JNDI context to look up from server's environment. The actual code is like this

which works fine when the server is running as it gets it from environment.

But when I want to run the code locally with a test class I can't get the dataSource.I see that DataSource class doesn't have setters for URL, login, password etc. Is there a way to get DataSource object locally?


What a wonderful world!
I agree. Here's the link:
subject: DataSource
It's not a secret anymore!