This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply 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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Database pooling with JNDI included
 
Similar Threads
Deploying Commons DBCP
wsad and oracle -SOS
How to get the DataSource Object in the servlet
Connection Pooling
JNDI design question