• 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

Getting DataSource from WAS - Cllient is outside the Container

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to get a database connection from a Java client application, which is outside the WAS container. i.e. a standalone java class.
A working DataSource is already configured in WAS 6, with connection pool [Security is NOT enabled].

A deployed servlet with the following code works fine:


However if the java client outside the container, trys to get a connection from the same Connection pool, there is a error. (The difference is in getting the InitialContext only)



This code, throws a ClassCastException , because the l_obj returned is not of type DataSource, but of Resource type.

1) Does that mean, Webspher does not allow its own DataBase connection pool to be used outside the container ?
2) If it is allowed, then how do accomplish this, in a standlaone java client?

Thanks
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As per my experience with websphere, We can not get the connection from datasource out of the container.

Shailesh
 
You can thank my dental hygienist for my untimely aliveness. So tiny:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic