• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to get the DataSource Object in the servlet

 
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Could you hold this puppy for a sec? I need to adjust this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic