Subject: Tyrex 1.0 and Getting a Connection Pool in 4.1.x
From: "Matt Raible" <[EMAIL PROTECTED]>
===
In Tomcat 4.0.x, I am able to get a database connection via JNDI using the
following code:
import tyrex.jdbc.xa.EnabledDataSource;
public Connection getPooledConnection() throws ServiceLocatorException
{
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
ds = (EnabledDataSource) envCtx.lookup(Constants.JNDI_DB);
} catch (NamingException ex) {
logCat.error("NamingException: " + ex.getMessage());
throw new ServiceLocatorException(ex);
}
try {
con = ds.getConnection();
} catch (SQLException ex) {
logCat.error("SQLException: " + ex.getMessage());
throw new ServiceLocatorException(ex);
}
return con;
}
What do I need to change for this to work in 4.1.x? Is there any way to
make the changes backward compatible with 4.0.x?
Thanks,
Matt
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>