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

How to get SQLServerDataSource reference....

 
nilesh bhattad
Greenhorn
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");
ds.setSelectMethod("cursor");
Connection con = ds.getConnection("RiskAppetiteAppID", "RiskAppetiteAppID");
System.out.println(con);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic