Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Not able to perform JNDI lookup in my servlet  RSS feed

 
Neha Sharma
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
I want to use JNDI lookup to use a datasource created in Websphere 4.0 and I'm getting a null exception. All I'm doing in my dataconnection bean is

try {
InitialContext ic = new InitialContext();
datasource = (DataSource) ic.lookup("OracleDSN");
Con = datasource.getConnection();
} catch
Can anybody help me what should I write to access this datasource "OracleDSN". I don't have any other thing in my code, do I need to define the LDAp hash table etc.
Thanks
Neha
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the question isn't "What am I doing wrong when I look this up", but instead you should be asking "How am I creating a datasource and cataloging it into JNDI?". If you don'
t put it in, you can't get it out!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!