You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Vance Christiaanse <ci...@twcny.rr.com> on 2002/09/03 18:13:11 UTC
Reflecting on Tomcat DataSources
Tomcat fans,
The list of "ResourceParams" you can specify for an environment resource is
different between Tomcat 4.0.x and 4.1.x. Below is some servlet code you can
run to get an idea of exactly what parameters you can set for your
DataSource.
Vance
===============================================
java.io.PrintWriter pw = resp.getWriter();
try {
resp.setContentType("text/plain");
javax.naming.Context ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql.DataSource)
ctx.lookup("java:comp/env/jdbc/Alpha");
Class c = ds.getClass();
java.lang.reflect.Method[] ms = c.getDeclaredMethods();
for (int i=0; i<ms.length; i++) {
if (ms[i].getName().startsWith("set") ) {
pw.println(ms[i]);
}
}
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>