• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Datasource from Context

 
Jeff Ma
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Getting Datasource from Context.
DataSource pool = (DataSource) env.lookup("jdbc/oracle-8i-athletes");

a) Place this code in init() of every servlet.
b) Place this code in a servlet that can be called along with application starting, then save the pool into application scope.
which solution is better?
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!