• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get the DataSource Object in the servlet  RSS feed

 
Malli Raman
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using weblogic Server and Oracle Database.
I want to access the Database and wants to use the Connection Pooling mechanism. I created one connection pool in the weblogic and also i created one datasource object.
Is it sufficient in the client side program to access the datasource Object to implement the connection pooling mechanism.
DataSource ds= (DataSource)ctx.lookup("DataSourceName");
In that the case what is the use of javax.sql.ConnectionPoolDataSource Object.
Regards,
M.S.Raman
 
abhi zulu
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The client can never get a reference to datasource object.
The datasource object must be given a JNDI name
then the weblogic server will look up for that JNDI name.
 
benb
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Malli Subramanian Raman:
Hi,
I am using weblogic Server and Oracle Database.
I want to access the Database and wants to use the Connection Pooling mechanism. I created one connection pool in the weblogic and also i created one datasource object.
Is it sufficient in the client side program to access the datasource Object to implement the connection pooling mechanism.
DataSource ds= (DataSource)ctx.lookup("DataSourceName");
In that the case what is the use of javax.sql.ConnectionPoolDataSource Object.
Regards,
M.S.Raman

The ConnectionPoolDataSource is an interface you don't use directly in your code if you are an application developper. Weblogic (or any standard connection pool implementation) will use it (internally) to implement its pooling mechanism.
Regards.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!