Platinum Partner

[Java] Read DataSource From Connection Pool (Tomcat And WAS4)


Context initContext;
initContext = new InitialContext();
DataSource ds = null;

if ("TOMCAT".equals(appServer)) {

      //Apache Tomcat Server
      ds = (DataSource)initContext.lookup("java:comp/env/jdbc/yourJNDI");

} else if  ("WAS4".equals(appServer)) {

      //IBM WebSphere 4.x
      ds = (DataSource)initContext.lookup("jdbc/yourJNDI");
                                
}
{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}