1,105,417 Community Members

get global datasource in tomcat?

Member Avatar
Light Poster
36 posts since Jun 2010
Reputation Points: -2 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]

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....

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: