Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic