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 49 public final class TriggerNewTransitionRows extends org.apache.derby.vti.UpdatableVTITemplate 50 { 51 52 private ResultSet resultSet; 53 54 65 public TriggerNewTransitionRows() throws SQLException 66 { 67 TriggerExecutionContext tec = Factory.getTriggerExecutionContext(); 68 if (tec == null) 69 { 70 throw new SQLException ("There are no active triggers", "38000"); 71 } 72 resultSet = tec.getNewRowSet(); 73 74 if (resultSet == null) 75 { 76 throw new SQLException ("There is no new transition rows result set for this trigger", "38000"); 77 } 78 } 79 80 public ResultSetMetaData getMetaData() throws SQLException 81 { 82 return resultSet.getMetaData(); 83 } 84 85 public ResultSet executeQuery() { 86 return resultSet; 87 } 88 89 public int getResultSetConcurrency() { 90 return JDBC20Translation.CONCUR_READ_ONLY; 91 } 92 93 public void close() throws SQLException { 94 resultSet.close(); 95 } 96 } 97 | Popular Tags |