Connection to Atomic Schema
Opening Connection: To open an atomic connection the getDBConnections method of ConnectionAdapter has to be invoked with infodom and is MetaConnection as parameters.
For example:
public boolean testMethod(String attr1) {
Connection atomicConn = null;
PreparedStatementDecorator prepStatement = null;
ResultSet rs = null;
try {
atomicConn = ConnectionAdapter.getDBConnections(infodom,false);
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;
}