• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting Datasource from Context  RSS feed

 
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?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!