public void installUpgrade ( final Class < ? extends UpgradeItem > upgradeClass , final long startTime , final long endTime ) throws SQLException { PreparedStatement statement = null ; try { statement = connection . prepareStatement ( "INSERT INTO \"INSTALLEDUPGRADES\" (\"UPGRADECLASS\", \"STARTTIME\", \"ENDTIME\") VALUES (?, ?, ?)" ) ; statement . setString ( 1 , upgradeClass . getCanonicalName ( ) ) ; statement . setTimestamp ( 2 , new Timestamp ( startTime ) ) ; statement . setTimestamp ( 3 , new Timestamp ( endTime ) ) ; statement . executeUpdate ( ) ; connection . commit ( ) ; LOGGER . debug ( "Added: " + upgradeClass . getCanonicalName ( ) + " to UpgradeMetaProcessor table (Starttime: " + startTime + "; Endtime: " + endTime + ")" ) ; } finally { DbUtil . close ( statement ) ; //DbUtil.close(connection); // do not close connection } }
Documents a record in the database for the specified class indicating it has been executed .