• 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

tomcat 4 jdbc-jndi questions: restart database

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I setup a jdbc-jndi to informix in my webapp with tomcat 4.0.3. Then I restart the database, and retest my webapp, I am suprise to see that the connection pool is still work, here is my code to get connection whenever I need one:
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
DataSource ds = (DataSource)envCtx.lookup("jdbc/informix");
Connection con = ds.getConnection();
My questions:
1) Is a new connection pool created everytime I use the code above? If so, then that is why it works even I restart database.
2) If not, then is tomcat validate the connection object before return it out? (otherwise I will get error when I use the connection object)
3) If it do validate the connection, any info. about how it get validated? i.e. simple select...?
Thanks.
David
reply
    Bookmark Topic Watch Topic
  • New Topic