1 21 22 package org.apache.derby.catalog; 23 24 import org.apache.derby.iapi.db.Factory; 25 import org.apache.derby.iapi.db.TriggerExecutionContext; 26 import org.apache.derby.iapi.reference.JDBC20Translation; 27 28 import java.sql.Connection ; 29 import java.sql.Statement ; 30 import java.sql.ResultSet ; 31 import java.sql.ResultSetMetaData ; 32 import java.sql.SQLException ; 33 import java.sql.SQLWarning ; 34 import java.math.BigDecimal ; 35 36 50 public class TriggerOldTransitionRows extends org.apache.derby.vti.UpdatableVTITemplate 51 { 52 53 private ResultSet resultSet; 54 55 66 public TriggerOldTransitionRows() throws SQLException 67 { 68 TriggerExecutionContext tec = Factory.getTriggerExecutionContext(); 69 if (tec == null) 70 { 71 throw new SQLException ("There are no active triggers", "38000"); 72 } 73 resultSet = tec.getOldRowSet(); 74 75 if (resultSet == null) 76 { 77 throw new SQLException ("There is no old transition rows result set for this trigger", "38000"); 78 } 79 } 80 81 public ResultSet executeQuery() { 82 return resultSet; 83 } 84 85 public int getResultSetConcurrency() { 86 return JDBC20Translation.CONCUR_READ_ONLY; 87 } 88 public void close() throws SQLException { 89 resultSet.close(); 90 } 91 } 92 | Popular Tags |