This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes JDBC and the fly likes Database pooling with JNDI included Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "Database pooling with JNDI included" Watch "Database pooling with JNDI included" New topic
Author

Database pooling with JNDI included

Abhay Raj
Greenhorn

Joined: May 22, 2012
Posts: 2
Friend…………i want to connect a database using datasource (pooling)…………..rather than using DriverManager.getConnection(url),

the database i m using is called dragon and username is root and password is ************
now the problem is , what should i provide in the following…….

cnt=new InitialContext();
cnt.bind(???, ds);
ds is DataSource instance…………..how do i connect…



how can i implement the URL in DataSource instance or how do we initiate it..........

Actually i want to create a class containing Connection and PrepareStament to implement the database connection...............................
please help....i m completely new to this concept.........
Wei Dai
Ranch Hand

Joined: Jun 22, 2005
Posts: 86
It's easy, but you need to know what's your DataSource class.
 
GeeCON Prague 2014
 
subject: Database pooling with JNDI included