• 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

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.
 
What's a year in metric? Do you know this metric stuff tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic