• 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
  • Tim Cooke
  • Jeanne Boyarsky
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Liutauras Vilda
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Piet Souris

Connection pool with multiple users

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Our application is deployed in websphere server and works with Teradata. Connection pooling is used through server settings for datasource. Java code for getting connection is as follows:

Context ctx = new InitialContext();
Datasource ds = (DataSource) ctx.lookup("java:comp/env/test");
Connection conn = ds.getConnection(username, password);

username and password could be different sometimes. My doubt is "Does connection get established each time ds.getConnection(username,password) is called"?
If connection need not be established every time and it uses connection pooling properly how does authentication works?

Can anybody please clarify my doubt?

Thanks & Regards,
Swathi.
 
Swathi Sri
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

Can anybody please clarify my doubt?

Thanks in advance..
Swathi.
 
author & internet detective
Posts: 41762
885
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swathi,
Any reason not to create a different datasource for the users if there is a small number of users? If there is a lot of users, you could create another id to access the database on their behalf.

I don't know what happens in your scenario as I've never had cause to do this. You could see if your datasource documentation says anything on this.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic