You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2006/05/25 20:23:58 UTC

svn commit: r409422 - in /db/derby/code/trunk/java: engine/org/apache/derby/catalog/ engine/org/apache/derby/impl/sql/compile/ engine/org/apache/derby/vti/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTe...

Author: djd
Date: Thu May 25 11:23:57 2006
New Revision: 409422

URL: http://svn.apache.org/viewvc?rev=409422&view=rev
Log:
DERBY-438 Support statement triggers for BLOB and CLOB types. Change the trigger
virtual tables to implement PreparedStatement instead of ResultSet. This allows
the mechanism to use the java.sql.ResultSet generated from the language internal
ResultSet directly, rather than through a wrapper. The wrapper approach caused
issues when the wrapper's JDBC version does not match the version running in the
engine. BLOB/CLOB caused problems with statement triggers as the wrapper
only supported JDBC 1.2. Add tests for BLOB (will add CLOB in subsequent patch),
also add upgrade tests across release boundaries to ensure trigger modifications
in 10.2 do not break in soft upgrade mode.

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerNewTransitionRows.java
    db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerOldTransitionRows.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Upgrade_10_1_10_2.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTester.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerNewTransitionRows.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerNewTransitionRows.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerNewTransitionRows.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerNewTransitionRows.java Thu May 25 11:23:57 2006
@@ -22,6 +22,8 @@
 
 import org.apache.derby.iapi.db.Factory;
 import org.apache.derby.iapi.db.TriggerExecutionContext;
+import org.apache.derby.iapi.reference.JDBC20Translation;
+
 import java.sql.Connection;
 import java.sql.Statement;
 import java.sql.ResultSet;
@@ -43,7 +45,7 @@
  *
  * @author jamie
  */
-public class TriggerNewTransitionRows extends org.apache.derby.vti.VTITemplate 
+public final class TriggerNewTransitionRows extends org.apache.derby.vti.UpdatableVTITemplate 
 {
 
 	private ResultSet resultSet;
@@ -72,400 +74,22 @@
 		{
 			throw new SQLException("There is no new transition rows result set for this trigger", "38000");
 		}
-    }  
-
-	/**
-	 * Provide the metadata for VTI interface.
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-	static public ResultSetMetaData getResultSetMetaData() throws SQLException
-	{
-		throw new SQLException("getResultSetMetaData() should not be called", "38000");
-    }
-
-    //
-    // java.sql.ResultSet calls, passed through to our result set.
-    //
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean next() throws SQLException {
-        return resultSet.next();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public void close() throws SQLException {
-        resultSet.close();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean wasNull() throws SQLException {
-        return resultSet.wasNull();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getString(int columnIndex) throws SQLException {
-        return resultSet.getString(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean getBoolean(int columnIndex) throws SQLException {
-        return resultSet.getBoolean(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte getByte(int columnIndex) throws SQLException {
-        return resultSet.getByte(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public short getShort(int columnIndex) throws SQLException {
-        return resultSet.getShort(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public int getInt(int columnIndex) throws SQLException {
-        return resultSet.getInt(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public long getLong(int columnIndex) throws SQLException {
-        return resultSet.getLong(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public float getFloat(int columnIndex) throws SQLException {
-        return resultSet.getFloat(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public double getDouble(int columnIndex) throws SQLException {
-        return resultSet.getDouble(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
-        return resultSet.getBigDecimal(columnIndex,scale);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte[] getBytes(int columnIndex) throws SQLException {
-        return resultSet.getBytes(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Date getDate(int columnIndex) throws SQLException {
-        return resultSet.getDate(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Time getTime(int columnIndex) throws SQLException {
-        return resultSet.getTime(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException {
-        return resultSet.getTimestamp(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException {
-        return resultSet.getAsciiStream(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
-        return resultSet.getUnicodeStream(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getBinaryStream(int columnIndex)
-        throws SQLException {
-            return resultSet.getBinaryStream(columnIndex);
-            }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getString(String columnName) throws SQLException {
-        return resultSet.getString(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean getBoolean(String columnName) throws SQLException {
-        return resultSet.getBoolean(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte getByte(String columnName) throws SQLException {
-        return resultSet.getByte(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public short getShort(String columnName) throws SQLException {
-        return resultSet.getShort(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public int getInt(String columnName) throws SQLException {
-        return resultSet.getInt(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public long getLong(String columnName) throws SQLException {
-        return resultSet.getLong(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public float getFloat(String columnName) throws SQLException {
-        return resultSet.getFloat(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public double getDouble(String columnName) throws SQLException {
-        return resultSet.getDouble(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
-        return resultSet.getBigDecimal(columnName,scale);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte[] getBytes(String columnName) throws SQLException {
-        return resultSet.getBytes(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Date getDate(String columnName) throws SQLException {
-        return resultSet.getDate(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Time getTime(String columnName) throws SQLException {
-        return resultSet.getTime(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Timestamp getTimestamp(String columnName) throws SQLException {
-        return resultSet.getTimestamp(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getAsciiStream(String columnName) throws SQLException {
-        return resultSet.getAsciiStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
-        return resultSet.getUnicodeStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getBinaryStream(String columnName)
-        throws SQLException {
-        return resultSet.getBinaryStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public SQLWarning getWarnings() throws SQLException {
-        return resultSet.getWarnings();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public void clearWarnings() throws SQLException {
-        resultSet.clearWarnings();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getCursorName() throws SQLException {
-        return resultSet.getCursorName();
     }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public ResultSetMetaData getMetaData() throws SQLException {
+    
+    public ResultSetMetaData getMetaData() throws SQLException
+    {
         return resultSet.getMetaData();
     }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public Object getObject(int columnIndex) throws SQLException {
-        return resultSet.getObject(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public Object getObject(String columnName) throws SQLException {
-        return resultSet.getObject(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public int findColumn(String columnName) throws SQLException {
-        return resultSet.findColumn(columnName);
-    }
-
+    
+   public ResultSet executeQuery() {
+       return resultSet;
+   }
+    
+   public int getResultSetConcurrency() {
+        return JDBC20Translation.CONCUR_READ_ONLY;
+   }
+   
+   public void close() throws SQLException {
+       resultSet.close();
+   }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerOldTransitionRows.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerOldTransitionRows.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerOldTransitionRows.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/catalog/TriggerOldTransitionRows.java Thu May 25 11:23:57 2006
@@ -22,6 +22,8 @@
 
 import org.apache.derby.iapi.db.Factory;
 import org.apache.derby.iapi.db.TriggerExecutionContext;
+import org.apache.derby.iapi.reference.JDBC20Translation;
+
 import java.sql.Connection;
 import java.sql.Statement;
 import java.sql.ResultSet;
@@ -44,7 +46,7 @@
  *
  * @author jamie
  */
-public class TriggerOldTransitionRows extends org.apache.derby.vti.VTITemplate
+public class TriggerOldTransitionRows extends org.apache.derby.vti.UpdatableVTITemplate
 {
 
 	private ResultSet resultSet;
@@ -75,398 +77,14 @@
 		}
     }  
 
-	/**
-	 * Provide the metadata for VTI interface.
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-	static public ResultSetMetaData getResultSetMetaData() throws SQLException
-	{
-		throw new SQLException("getResultSetMetaData() should not be called", "38000");
-    }
-
-    //
-    // java.sql.ResultSet calls, passed through to our result set.
-    //
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean next() throws SQLException {
-        return resultSet.next();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public void close() throws SQLException {
-        resultSet.close();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean wasNull() throws SQLException {
-        return resultSet.wasNull();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getString(int columnIndex) throws SQLException {
-        return resultSet.getString(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean getBoolean(int columnIndex) throws SQLException {
-        return resultSet.getBoolean(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte getByte(int columnIndex) throws SQLException {
-        return resultSet.getByte(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public short getShort(int columnIndex) throws SQLException {
-        return resultSet.getShort(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public int getInt(int columnIndex) throws SQLException {
-        return resultSet.getInt(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public long getLong(int columnIndex) throws SQLException {
-        return resultSet.getLong(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public float getFloat(int columnIndex) throws SQLException {
-        return resultSet.getFloat(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public double getDouble(int columnIndex) throws SQLException {
-        return resultSet.getDouble(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException {
-        return resultSet.getBigDecimal(columnIndex,scale);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte[] getBytes(int columnIndex) throws SQLException {
-        return resultSet.getBytes(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Date getDate(int columnIndex) throws SQLException {
-        return resultSet.getDate(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Time getTime(int columnIndex) throws SQLException {
-        return resultSet.getTime(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException {
-        return resultSet.getTimestamp(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getAsciiStream(int columnIndex) throws SQLException {
-        return resultSet.getAsciiStream(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getUnicodeStream(int columnIndex) throws SQLException {
-        return resultSet.getUnicodeStream(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getBinaryStream(int columnIndex)
-        throws SQLException {
-            return resultSet.getBinaryStream(columnIndex);
-            }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getString(String columnName) throws SQLException {
-        return resultSet.getString(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public boolean getBoolean(String columnName) throws SQLException {
-        return resultSet.getBoolean(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte getByte(String columnName) throws SQLException {
-        return resultSet.getByte(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public short getShort(String columnName) throws SQLException {
-        return resultSet.getShort(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public int getInt(String columnName) throws SQLException {
-        return resultSet.getInt(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public long getLong(String columnName) throws SQLException {
-        return resultSet.getLong(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public float getFloat(String columnName) throws SQLException {
-        return resultSet.getFloat(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public double getDouble(String columnName) throws SQLException {
-        return resultSet.getDouble(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException {
-        return resultSet.getBigDecimal(columnName,scale);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public byte[] getBytes(String columnName) throws SQLException {
-        return resultSet.getBytes(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Date getDate(String columnName) throws SQLException {
-        return resultSet.getDate(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Time getTime(String columnName) throws SQLException {
-        return resultSet.getTime(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.sql.Timestamp getTimestamp(String columnName) throws SQLException {
-        return resultSet.getTimestamp(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getAsciiStream(String columnName) throws SQLException {
-        return resultSet.getAsciiStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getUnicodeStream(String columnName) throws SQLException {
-        return resultSet.getUnicodeStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public java.io.InputStream getBinaryStream(String columnName)
-        throws SQLException {
-        return resultSet.getBinaryStream(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public SQLWarning getWarnings() throws SQLException {
-        return resultSet.getWarnings();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public void clearWarnings() throws SQLException {
-        resultSet.clearWarnings();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public String getCursorName() throws SQLException {
-        return resultSet.getCursorName();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public ResultSetMetaData getMetaData() throws SQLException {
-        return resultSet.getMetaData();
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public Object getObject(int columnIndex) throws SQLException {
-        return resultSet.getObject(columnIndex);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-    public Object getObject(String columnName) throws SQLException {
-        return resultSet.getObject(columnName);
-    }
-
-	/**
-	 * @see java.sql.ResultSet
-	 *
- 	 * @exception SQLException on unexpected JDBC error
-	 */
-   public int findColumn(String columnName) throws SQLException {
-        return resultSet.findColumn(columnName);
-    }
-
+       public ResultSet executeQuery() {
+           return resultSet;
+       }
+        
+       public int getResultSetConcurrency() {
+            return JDBC20Translation.CONCUR_READ_ONLY;
+       }
+       public void close() throws SQLException {
+           resultSet.close();
+       }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/FromVTI.java Thu May 25 11:23:57 2006
@@ -534,7 +534,7 @@
 		{
 			version2 = true;
 		}
-
+        
 		/* If this is a version 2 VTI */
 		if (version2)
 		{
@@ -1273,11 +1273,14 @@
 										   MethodBuilder mb, boolean reuseablePs)
 		throws StandardException
 	{
+        
+        String vtiType = version2 ?
+                "java.sql.PreparedStatement" : "java.sql.ResultSet";
 		// this sets up the method and the static field.
 		// generates:
 		// 	java.sql.ResultSet userExprFun { }
 		MethodBuilder userExprFun = acb.newGeneratedFun(
-			version2 ? "java.sql.PreparedStatement" : "java.sql.ResultSet", Modifier.PUBLIC);
+                vtiType, Modifier.PUBLIC);
 		userExprFun.addThrownException("java.lang.Exception");
 
 
@@ -1291,6 +1294,7 @@
 		}
 
 		newInvocation.generateExpression(acb, userExprFun);
+        userExprFun.upCast(vtiType);
 
 		if (reuseablePs) {
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java Thu May 25 11:23:57 2006
@@ -60,15 +60,7 @@
  */
 public abstract class UpdatableVTITemplate implements PreparedStatement 
 {
-
-    //
-    // java.sql.Statement calls, passed through to our preparedStatement.
-    //
-	/**
-		@deprecated Cloudscape 5.1 no longer supports read-write VTI's with JDBC 1.2. Applications
-		can use the UpdatableVTITemplate to implement a read-write VTI.
-	*/
-	public UpdatableVTITemplate() {}
+	protected UpdatableVTITemplate() {}
 
 	/**
 	 * @see java.sql.Statement

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/blobclob4BLOB.out Thu May 25 11:23:57 2006
@@ -727,6 +727,7 @@
 START: blobTest8Trigger
 Row Count 0 Null Row 0
 Row Count 9 Null Row 1
+Row Count 9 Null Row 1
 blobTest8Trigger finished
 START: blobTest91
 done row 0, length was 0

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/blobclob4BLOB.out Thu May 25 11:23:57 2006
@@ -726,6 +726,7 @@
 START: blobTest8Trigger
 Row Count 0 Null Row 0
 Row Count 9 Null Row 1
+Row Count 9 Null Row 1
 blobTest8Trigger finished
 START: blobTest91
 done row 0, length was 0

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Upgrade_10_1_10_2.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Upgrade_10_1_10_2.out?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Upgrade_10_1_10_2.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/Upgrade_10_1_10_2.out Thu May 25 11:23:57 2006
@@ -3,6 +3,12 @@
 complete caseReusableRecordIdSequenceNumber - passed true
 complete caseInitialize - passed true
 complete caseProcedures - passed true
+Trigger VTI Phase: CREATE
+D438.T438_T1
+1, DERBY-438_ROW
+1, DERBY-438_STMT
+D438.T438_T2
+complete caseTriggerVTI - passed true
 Test metadata starting
 Union Result -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
 dec(10,2) -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
@@ -24,6 +30,7 @@
 getSchemas():
 TABLE_SCHEM[VARCHAR]
 APP
+D438
 NULLID
 SQLJ
 SYS
@@ -279,6 +286,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTables() with TABLE_TYPE in ('VIEW','TABLE') :
 TABLE_CAT[VARCHAR],TABLE_SCHEM[VARCHAR],TABLE_NAME[VARCHAR],TABLE_TYPE[VARCHAR],REMARKS[VARCHAR]
@@ -291,6 +301,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTableTypes():
 TABLE_TYPE[VARCHAR]
@@ -689,6 +702,14 @@
 complete caseReusableRecordIdSequenceNumber - passed true
 complete caseInitialize - passed true
 complete caseProcedures - passed true
+Trigger VTI Phase: SOFT UPGRADE
+D438.T438_T1
+1, DERBY-438_ROW
+1, DERBY-438_STMT
+D438.T438_T2
+1, 104
+1, 4004
+complete caseTriggerVTI - passed true
 Test metadata starting
 Union Result -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
 dec(10,2) -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
@@ -710,6 +731,7 @@
 getSchemas():
 TABLE_SCHEM[VARCHAR],TABLE_CATALOG[VARCHAR]
 APP,null
+D438,null
 NULLID,null
 SQLJ,null
 SYS,null
@@ -723,6 +745,7 @@
 getSchemas(String, String):
 TABLE_SCHEM[VARCHAR],TABLE_CATALOG[VARCHAR]
 APP,null
+D438,null
 NULLID,null
 SQLJ,null
 SYS,null
@@ -1050,6 +1073,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTables() with TABLE_TYPE in ('VIEW','TABLE') :
 TABLE_CAT[VARCHAR],TABLE_SCHEM[VARCHAR],TABLE_NAME[VARCHAR],TABLE_TYPE[VARCHAR],REMARKS[VARCHAR]
@@ -1062,6 +1088,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTableTypes():
 TABLE_TYPE[VARCHAR]
@@ -1421,6 +1450,14 @@
 complete caseReusableRecordIdSequenceNumber - passed true
 complete caseInitialize - passed true
 complete caseProcedures - passed true
+Trigger VTI Phase: POST SOFT UPGRADE
+D438.T438_T1
+1, DERBY-438_ROW
+1, DERBY-438_STMT
+D438.T438_T2
+1, 105
+1, 4005
+complete caseTriggerVTI - passed true
 Test metadata starting
 Union Result -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
 dec(10,2) -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
@@ -1442,6 +1479,7 @@
 getSchemas():
 TABLE_SCHEM[VARCHAR]
 APP
+D438
 NULLID
 SQLJ
 SYS
@@ -1697,6 +1735,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTables() with TABLE_TYPE in ('VIEW','TABLE') :
 TABLE_CAT[VARCHAR],TABLE_SCHEM[VARCHAR],TABLE_NAME[VARCHAR],TABLE_TYPE[VARCHAR],REMARKS[VARCHAR]
@@ -1709,6 +1750,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTableTypes():
 TABLE_TYPE[VARCHAR]
@@ -2106,6 +2150,14 @@
 complete caseReusableRecordIdSequenceNumber - passed true
 complete caseInitialize - passed true
 complete caseProcedures - passed true
+Trigger VTI Phase: UPGRADE
+D438.T438_T1
+1, DERBY-438_ROW
+1, DERBY-438_STMT
+D438.T438_T2
+1, 106
+1, 4006
+complete caseTriggerVTI - passed true
 Test metadata starting
 Union Result -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
 dec(10,2) -- precision: 10 scale: 2 display size: 13 type name: DECIMAL
@@ -2127,6 +2179,7 @@
 getSchemas():
 TABLE_SCHEM[VARCHAR],TABLE_CATALOG[VARCHAR]
 APP,null
+D438,null
 NULLID,null
 SQLJ,null
 SYS,null
@@ -2140,6 +2193,7 @@
 getSchemas(String, String):
 TABLE_SCHEM[VARCHAR],TABLE_CATALOG[VARCHAR]
 APP,null
+D438,null
 NULLID,null
 SQLJ,null
 SYS,null
@@ -2475,6 +2529,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTables() with TABLE_TYPE in ('VIEW','TABLE') :
 TABLE_CAT[VARCHAR],TABLE_SCHEM[VARCHAR],TABLE_NAME[VARCHAR],TABLE_TYPE[VARCHAR],REMARKS[VARCHAR]
@@ -2487,6 +2544,9 @@
 ,APP,REFTAB2,TABLE,
 ,APP,T,TABLE,
 ,APP,TABLE1,TABLE,
+,D438,T438,TABLE,
+,D438,T438_T1,TABLE,
+,D438,T438_T2,TABLE,
 ,APP,SCREWIE,VIEW,
 getTableTypes():
 TABLE_TYPE[VARCHAR]

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/blobclob4BLOB.out Thu May 25 11:23:57 2006
@@ -777,6 +777,7 @@
 START: blobTest8Trigger
 Row Count 0 Null Row 0
 Row Count 9 Null Row 1
+Row Count 9 Null Row 1
 blobTest8Trigger finished
 START: blobTest91
 done row 0, length was 0

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/blobclob4BLOB.java Thu May 25 11:23:57 2006
@@ -3163,13 +3163,18 @@
         System.out.println(START + "blobTest8Trigger");
         try {
             Statement stmt = conn.createStatement();
-            stmt.executeUpdate("CREATE TABLE blobTest8TriggerA (a BLOB(300k), b int, crc32 BIGINT)");
-            stmt.executeUpdate("CREATE TABLE blobTest8TriggerB (a BLOB(200k), b int, crc32 BIGINT)");
+            stmt.executeUpdate("CREATE TABLE blobTest8TriggerA (a BLOB(400k), b int, crc32 BIGINT)");
+            stmt.executeUpdate("CREATE TABLE blobTest8TriggerB (a BLOB(400k), b int, crc32 BIGINT)");
             stmt.executeUpdate(
                     "create trigger T8A after update on testBlob " +
                     "referencing new as n old as o " + 
                     "for each row mode db2sql "+ 
                     "insert into blobTest8TriggerA(a, b, crc32) values (n.a, n.b, n.crc32)");
+            stmt.executeUpdate(
+                    "create trigger T8B after INSERT on blobTest8TriggerA " +
+                    "referencing new_table as n " + 
+                    "for each statement mode db2sql "+ 
+                    "insert into blobTest8TriggerB(a, b, crc32) select n.a, n.b, n.crc32 from n");            
             
             conn.commit();
             ResultSet rs = stmt.executeQuery(
@@ -3182,12 +3187,29 @@
             rs = stmt.executeQuery(
                 "select a,b,crc32 from blobTest8TriggerA");
             testBlobContents(rs);
+            rs.close();
+            conn.commit();
+            
+            rs = stmt.executeQuery(
+                "select a,b,crc32 from blobTest8TriggerB");
+            testBlobContents(rs);
+            rs.close();
+            conn.commit();
+            stmt.executeUpdate("DROP TRIGGER T8A");
+            stmt.executeUpdate("DROP TABLE blobTest8TriggerB");
+            stmt.executeUpdate("DROP TABLE blobTest8TriggerA");
+            
             stmt.close();
             conn.commit();
             System.out.println("blobTest8Trigger finished");
         }
         catch (SQLException e) {
             TestUtil.dumpSQLExceptions(e);
+            do {
+            e.printStackTrace(System.out);
+            e = e.getNextException();
+            } while (e != null);
+            
         }
         catch (Throwable e) {
             System.out.println("FAIL -- unexpected exception:" + e.toString());

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTester.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTester.java?rev=409422&r1=409421&r2=409422&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTester.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/upgradeTests/UpgradeTester.java Thu May 25 11:23:57 2006
@@ -59,6 +59,7 @@
     <P>
 	This tests the following specifically.
 
+    <BR>
 	10.1 Upgrade issues
 
 	<UL>
@@ -67,9 +68,14 @@
 	
 	Metadata tests
 	
-	10.2 Upgrade tests:
+    <BR>
+	10.2 Upgrade tests
+    <UL>
+    <LI> caseReusableRecordIdSequenceNumber
+    <LI> Trigger action re-writing and implementation changes (DERBY-438)
+    </UL>
+	
 	
-	caseReusableRecordIdSequenceNumber
 	
  */
 public class UpgradeTester {
@@ -354,6 +360,8 @@
 			passed = caseInitialize(conn, phase) && passed;
 			passed = caseProcedures(conn, phase, oldMajorVersion, 
 									oldMinorVersion) && passed;
+            passed = caseTriggerVTI(conn, phase, oldMajorVersion, 
+                    oldMinorVersion) && passed;
 			runMetadataTest(classLoader, conn);
 			conn.close();
 			shutdown(classLoader, dbName);
@@ -684,7 +692,111 @@
 		System.out.println("complete caseProcedures - passed " + passed);
 		return passed;
 	}
-	
+    /**
+     * Triger (internal) VTI
+     * 10.2 - Check that a statement trigger created in 10.0
+     * or 10.1 can be executed in 10.2 and that a statement
+     * trigger created in soft upgrade in 10.2 can be used
+     * in older releases.
+     * 
+     * The VTI implementing statement triggers changed in
+     * 10.2 from implementations of ResultSet to implementations
+     * of PreparedStatement. See DERBY-438. The internal
+     * api for the re-written action statement remains the
+     * same. The re-compile of the trigger on version changes
+     * should automatically switch between the two implementations.
+     *
+     * @param conn Connection
+     * @param phase Upgrade test phase
+     * @param dbMajor Major version of old release 
+     * @param dbMinor Minor version of old release
+     * @return true, if the test passes
+     * @throws SQLException
+     */
+    private boolean caseTriggerVTI(Connection conn, int phase, 
+                                    int dbMajor, int dbMinor)
+                                    throws SQLException {
+                
+        boolean passed = true;
+        
+        Statement s = conn.createStatement();
+
+        switch (phase) {
+        case PH_CREATE:
+            s.execute("CREATE TABLE D438.T438(a int, b varchar(20), c int)");
+            s.execute("INSERT INTO D438.T438 VALUES(1, 'DERBY-438', 2)");
+            s.execute("CREATE TABLE D438.T438_T1(a int, b varchar(20))");
+            s.execute("CREATE TABLE D438.T438_T2(a int, c int)");
+            s.execute(
+               "create trigger D438.T438_ROW_1 after UPDATE on D438.T438 " +
+               "referencing new as n old as o " + 
+               "for each row mode db2sql "+ 
+               "insert into D438.T438_T1(a, b) values (n.a, n.b || '_ROW')");
+            s.executeUpdate(
+               "create trigger D438.T438_STMT_1 after UPDATE on D438.T438 " +
+               "referencing new_table as n " + 
+               "for each statement mode db2sql "+ 
+               "insert into D438.T438_T1(a, b) select n.a, n.b || '_STMT' from n"); 
+            
+            conn.commit();
+            showTriggerVTITables(phase, s);
+            break;
+        case PH_SOFT_UPGRADE:
+            s.execute(
+               "create trigger D438.T438_ROW_2 after UPDATE on D438.T438 " +
+               "referencing new as n old as o " + 
+               "for each row mode db2sql "+ 
+               "insert into D438.T438_T2(a, c) values (n.a, n.c + 100)");
+             s.executeUpdate(
+                "create trigger D438.T438_STMT_2 after UPDATE on D438.T438 " +
+                "referencing new_table as n " + 
+                "for each statement mode db2sql "+ 
+                "insert into D438.T438_T2(a, c) select n.a, n.c + 4000 from n"); 
+                 
+            conn.commit();
+            showTriggerVTITables(phase, s);
+            break;
+        case PH_POST_SOFT_UPGRADE:
+            showTriggerVTITables(phase, s);
+            break;
+        case PH_HARD_UPGRADE:
+            showTriggerVTITables(phase, s);
+           break;
+        default:
+            passed = false;
+            break;
+        }
+        s.close();
+
+        System.out.println("complete caseTriggerVTI - passed " + passed);
+        return passed;
+    }
+    
+    /**
+     * Display the tables populated by the triggers.
+    */
+    private void showTriggerVTITables(int phase, Statement s) throws SQLException
+    {
+        System.out.println("Trigger VTI Phase: " + PHASES[phase]);
+        s.executeUpdate("UPDATE D438.T438 set c = c + 1");
+        s.getConnection().commit();
+        System.out.println("D438.T438_T1");
+        ResultSet rs = s.executeQuery("SELECT a,b from D438.T438_T1 ORDER BY 2");
+        while (rs.next()) {
+            System.out.println(rs.getInt(1) + ", " + rs.getString(2));
+        }
+        rs.close();
+        System.out.println("D438.T438_T2");
+        rs = s.executeQuery("SELECT a,c from D438.T438_T2 ORDER BY 2");
+        while (rs.next()) {
+            System.out.println(rs.getInt(1) + ", " + rs.getString(2));
+        }
+        rs.close();
+        s.executeUpdate("DELETE FROM D438.T438_T1");
+        s.executeUpdate("DELETE FROM D438.T438_T2");
+        s.getConnection().commit();
+    }
+    	
 	/**
 	 * Run metadata test
 	 *