• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to get SQLServerDataSource reference....  RSS feed

 
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
Boost this thread!