• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get SQLServerDataSource reference....

nilesh bhattad
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to get a referece of SQLServerDataSouce from JNDI... ?
Following code throws ClassCastException....
Context ctx = (Context) new InitialContext();
SQLServerDataSource ds = (SQLServerDataSource) ctx.lookup("jdbc/RiskAppetite");
Connection con = ds.getConnection("RiskAppetiteAppID", "RiskAppetiteAppID");
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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!