We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,188 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

get global datasource in tomcat?

how to lookup datasource which is created in glassfish with some jndi/dbname name.

I am trying to get datasource writing code in a servlet like this

Datasource datasource = (Datasource)initialContext.lookup("jdbc/customer");
Connection con = datasource.getConnection();
but it is throwing NameNotFoudExcepion for this context .

how can access datasource created outside of tomcat that is in Glassfish
in our servlets....

1
Contributor
0
Replies
1
View
madhub2v
Light Poster
36 posts since Jun 2010
Reputation Points: 8
Solved Threads: 0
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0568 seconds using 2.64MB