Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to use ConnectionPoolDataSource

Vijay Kumar
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi... all
I have written a code to get connection from databse using DataSource
but it is displaying null.... please tell me if I am doing something wrong..
my code is here....

InitialContext init=new InitialContext();
Context ctx=(Context)init.lookup("java:comp/env");
ConnectionPoolDataSource ds=(ConnectionPoolDataSource)ctx.lookup("jdbc/nokia.psireports");

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!