}
public Instance getInstanceByID( InstanceID instanceID ) {
InstanceImpl retVal = null;
Connection connection = null;
try {
String sql = "select * from bpm_instance" +
" where instanceid = " + instanceID.getID();
connection = getConnection();
Statement statement = connection.createStatement();
ResultSet result = statement.executeQuery( sql );
result.next();
retVal = new InstanceImpl();
retVal.setInstanceID( new InstanceID(
result.getInt( "instanceid" ) ) );
retVal.setBusinessProcessID( new BusinessProcessID(
result.getInt( "processid" ) ) );
retVal.setGraphName( result.getString( "graphname" ) );
retVal.setInstanceVariables(
SerializeUtil.deserializeAppParam( result.getBytes( "params" ) ) );
retVal.setStartDate( result.getDate( "startdate" ) );
retVal.setLastStepDate( result.getDate( "stepdate" ) );
retVal.setStatus( result.getInt( "status" ) );
result.close();
statement.close();
} catch( SQLException e ) {
throw new RuntimeException( e );