Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Can I get a database pool with JNDI?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to get to the database through the database pool which is running on an application server. Can I use JNDI to do this from an application that does not run inside the application server? Or are the database pools only available for anything inside the application server? You know what I mean?

Thanks,

J.
 
Ranch Hand
Posts: 489
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did you get an error when you tried? The answer is yes when the app server is running. Now whether this is recommended is another question

ram.

 
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jennifer Debroone wrote:I want to get to the database through the database pool which is running on an application server. Can I use JNDI to do this from an application that does not run inside the application server? Or are the database pools only available for anything inside the application server? You know what I mean?


Question: If you are wanting to hit an application server in order to get to a DataSource (connection pool) then why not just build a data service (EJB) on the application server and call the service rather than trying to get a JDBC connection? I'm not saying you should not do as you are planning, just that you should have a very good reason.
 
Jennifer Debroone
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ran Pleasant wrote:

Jennifer Debroone wrote:I want to get to the database through the database pool which is running on an application server. Can I use JNDI to do this from an application that does not run inside the application server? Or are the database pools only available for anything inside the application server? You know what I mean?


Question: If you are wanting to hit an application server in order to get to a DataSource (connection pool) then why not just build a data service (EJB) on the application server and call the service rather than trying to get a JDBC connection? I'm not saying you should not do as you are planning, just that you should have a very good reason.



ya, good idea, thanks for the answer !
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic