| 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.
|
 |
 |
|
|
subject: Database pooling with JNDI included
|
|
|