package com.ibm.jbatch.container.services.impl;
logger.config("Entering CLASSNAME.init(), batchConfig =" + batchConfig);
". One cause of this could be that the batch runtime is incorrectly configured to EE mode when it should be in SE mode.");
Checks if the default schema JBATCH or the schema defined in batch-config exists.
Creates the default schema JBATCH or the schema defined in batch-config.
Checks if all the runtime batch table exists. If not, it creates them.
Creates tableName using the createTableStatement DDL.
Executes the provided SQL statement
- Returns:
- the database connection and sets it to the default schema JBATCH or the schema defined in batch-config.
- Throws:
java.sql.SQLException
logger.finest("J2EE mode, getting connection from data source");
- Returns:
- the database connection. The schema is set to whatever default its used by the underlying database.
- Throws:
java.sql.SQLException
logger.finest("J2EE mode, getting connection from data source");
logException("FAILED GETTING DATABASE CONNECTION. FOR EMBEDDED DERBY CHECK FOR OTHER USER LOCKING THE CURRENT DATABASE (Try using a different database instance).", e);
logger.finest("Exiting from getConnectionToDefaultSchema, conn= " +connection);
Set the default schema JBATCH or the schema defined in batch-config on the connection object.
select data from DB table
- Parameters:
key
- the IPersistenceDataKey object- Returns:
- List of serializable objects store in the DB table
Ex. select id, obj from tablename where id = ?
insert data to DB table
- Parameters:
key
- the IPersistenceDataKey objectvalue
- serializable object to store
Ex. insert into tablename values(?, ?)
update data in DB table
- Parameters:
value
- serializable object to storekey
- the IPersistenceDataKey objectquery
- SQL statement to execute.
Ex. update tablename set obj = ? where id = ?
closes connection, result set and statement
- Parameters:
conn
- connection object to closers
- result set object to closestatement
- statement object to close
closes connection and statement
- Parameters:
conn
- connection object to closestatement
- statement object to close
statement = conn.prepareStatement("select count(jobinstanceid) as jobinstancecount from jobinstancedata where name = ? and apptag = ?");
count = rs.getInt("jobinstancecount");
count = rs.getInt("jobinstancecount");
statement = conn.prepareStatement("select jobinstanceid from jobinstancedata where name = ? and apptag = ? order by jobinstanceid desc");
long id = rs.getLong("jobinstanceid");
return data.subList(start, start+count);
long id = rs.getLong("jobinstanceid");
return data.subList(start, start+count);
statement = conn.prepareStatement("select distinct jobinstanceid, name from jobinstancedata where name " + filter );
long id = rs.getLong("jobinstanceid");
statement = conn.prepareStatement("select createtime, endtime, updatetime, starttime from executioninstancedata where jobexecid = ?");
statement = conn.prepareStatement("select batchstatus from executioninstancedata where jobexecid = ?");
statement = conn.prepareStatement("select exitstatus from executioninstancedata where jobexecid = ?");
statement = conn.prepareStatement("select jobinstanceid from executioninstancedata where jobexecid = ?");
jobinstanceID = rs.getLong("jobinstanceid");
String msg = "Did not find job instance associated with executionID =" + executionID;
statement = conn.prepareStatement("select parameters from executioninstancedata where jobexecid = ?");
String msg = "Did not find table entry for executionID =" + executionId;
long processSkipCount = 0;
statement = conn.prepareStatement("select A.* from stepexecutioninstancedata as A inner join executioninstancedata as B on A.jobexecid = B.jobexecid where B.jobinstanceid = ? order by A.stepexecid desc");
jobexecid = rs.getLong("jobexecid");
readCount = rs.getLong("readcount");
writeCount = rs.getLong("writecount");
commitCount = rs.getLong("commitcount");
rollbackCount = rs.getLong("rollbackcount");
readSkipCount = rs.getLong("readskipcount");
processSkipCount = rs.getLong("processskipcount");
filterCount = rs.getLong("filtercount");
writeSkipCount = rs.getLong("writeSkipCount");
byte[] pDataBytes = rs.getBytes("persistentData");
if (pDataBytes != null) {
data.put(stepname, stepEx);
long processSkipCount = 0;
statement = conn.prepareStatement("select * from stepexecutioninstancedata where jobexecid = ?");
jobexecid = rs.getLong("jobexecid");
stepexecid = rs.getLong("stepexecid");
readCount = rs.getLong("readcount");
writeCount = rs.getLong("writecount");
commitCount = rs.getLong("commitcount");
rollbackCount = rs.getLong("rollbackcount");
readSkipCount = rs.getLong("readskipcount");
processSkipCount = rs.getLong("processskipcount");
filterCount = rs.getLong("filtercount");
writeSkipCount = rs.getLong("writeSkipCount");
byte[] pDataBytes = rs.getBytes("persistentData");
if (pDataBytes != null) {