Connection to Config Schema
To open a Config Schema connection, the getDBConnections method of ConnectionAdapter has to be invoked.
Connection configConn = ConnectionAdapter.getDBConnections();
For example:
public boolean testMethod(String attr1) {
Connection configConn = null;
PreparedStatementDecorator prepStatement = null;
ResultSet rs = null;
try {
configConn = ConnectionAdapter.getDBConnections();
prepStatement = new PreparedStatementDecorator(configConn,query);
prepStatement.setString(1, attr1);
rs = prepStatement.executeQuery();
while (rs.next()) {
return true;
}
}
catch (Exception e) {
WorkflowUtil.logDebug("Error while updating process execution status...+
e);
}
finally {
ConnectionAdapter.closeResultSet(rs);
ConnectionAdapter.closePreparedStatement(prepStatement);
ConnectionAdapter.closeConnection(configConn);
}
return false;
}