* @throws Exception
*/
private void assertSecMecWithConnPoolingOK(
String user, String password, Short secmec) throws Exception
{
ConnectionPoolDataSource cpds = getCPDS(user,password);
// call setSecurityMechanism with secmec.
JDBCDataSource.setBeanProperty(cpds,
"SecurityMechanism", secmec);
// simulate case when connection will be re-used by getting
// a connection, closing it and then the next call to
// getConnection will re-use the previous connection.
PooledConnection pc = cpds.getPooledConnection();
Connection conn = pc.getConnection();
conn.close();
conn = pc.getConnection();
assertConnectionOK(conn);
pc.close();