|
From: Martin C. <mus...@us...> - 2002-12-04 18:47:41
|
Bill,
Just upgraded to proxool-0.5 on a webapp using tomcat 4.0. I'm using the Sun
Java SDK 1.4.0.
Everything worked fine with proxool-0.4, but the upgrade throws the
following exception:
java.lang.ClassCastException: $Proxy2
at $Proxy1.createStatement(Unknown Source)
I've attached my driver initialisation code incase there is a new
configuration that I missed, although this appears to work alright. The
stack trace shows that my exception occurs when calling
Connection.createStatement(). Perhaps a VM or JDBC version issue? I
downloaded the jar, I have not compiled from sources.
Thanks.
Martin
// Get the init url parameter
String sJdbcUrl= oContext.getInitParameter("JDBC_URL");
String sJdbcDriver = oContext.getInitParameter("JDBC_DRIVER");
String sJdbcPoolMaxConn=
oContext.getInitParameter("JDBC_POOL_MAX_CONNECTIONS");
String sJdbcPoolMinConn=
oContext.getInitParameter("JDBC_POOL_MIN_CONNECTIONS");
String sJdbcPoolTestSql= oContext.getInitParameter("JDBC_POOL_TEST_SQL");
Properties oProperties = new Properties();
oProperties.setProperty("proxool.maximum-connection-count",
sJdbcPoolMaxConn);
oProperties.setProperty("proxool.maximum-new-connections",
sJdbcPoolMinConn);
oProperties.setProperty("proxool.house-keeping-test-sql",
sJdbcPoolTestSql);
m_sJdbcUrl = "proxool:" + sJdbcDriver + ":" + sJdbcUrl;
try {
// Register the connection pool
Class.forName(JDBC_CONNECTION_POOL_DRIVER);
} catch (Exception e) {
throw new SQLException("Cannot find JDBC Connection Pool driver: " +
JDBC_CONNECTION_POOL_DRIVER);
}
try {
// Register the JDBC driver
Class.forName(sJdbcDriver);
} catch (Exception e) {
throw new SQLException("Cannot find JDBC driver: " + sJdbcDriver);
}
Connection oConnection = DriverManager.getConnection(m_sJdbcUrl,
oProperties);
if (oConnection != null) {
m_bInitialised = true;
return(oConnection);
}
throw new SQLException("Unable to initialize JDBC Connection Pool");
|