Adding JMCR-Stable version
[Benchmarks_CSolver.git] / JMCR-Stable / real-world application / MyDerby-10.3 / java / engine / org / apache / derby / vti / UpdatableVTITemplate.java
diff --git a/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java b/JMCR-Stable/real-world application/MyDerby-10.3/java/engine/org/apache/derby/vti/UpdatableVTITemplate.java
new file mode 100644 (file)
index 0000000..d728745
--- /dev/null
@@ -0,0 +1,730 @@
+/*\r
+\r
+   Derby - Class org.apache.derby.vti.UpdatableVTITemplate\r
+\r
+   Licensed to the Apache Software Foundation (ASF) under one or more\r
+   contributor license agreements.  See the NOTICE file distributed with\r
+   this work for additional information regarding copyright ownership.\r
+   The ASF licenses this file to You under the Apache License, Version 2.0\r
+   (the "License"); you may not use this file except in compliance with\r
+   the License.  You may obtain a copy of the License at\r
+\r
+      http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+   Unless required by applicable law or agreed to in writing, software\r
+   distributed under the License is distributed on an "AS IS" BASIS,\r
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+   See the License for the specific language governing permissions and\r
+   limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.vti;\r
+\r
+import java.io.InputStream;\r
+import java.io.Reader;\r
+import java.math.BigDecimal;\r
+import java.net.URL;\r
+import java.sql.Array;\r
+import java.sql.Blob;\r
+import java.sql.Clob;\r
+import java.sql.Connection;\r
+import java.sql.Date;\r
+import java.sql.ParameterMetaData;\r
+import java.sql.PreparedStatement;\r
+import java.sql.Ref;\r
+import java.sql.ResultSet;\r
+import java.sql.ResultSetMetaData;\r
+import java.sql.SQLException;\r
+import java.sql.SQLWarning;\r
+import java.sql.Time;\r
+import java.sql.Timestamp;\r
+import java.util.Calendar;\r
+\r
+import org.apache.derby.iapi.reference.JDBC20Translation;\r
+\r
+/**\r
+\r
+   An abstract implementation of PreparedStatement (JDBC 3.0) that is useful\r
+       when writing a read-write (updatable) virtual table interface (VTI).\r
+       \r
+       This class implements\r
+       the methods of the JDBC3.0 version of PreparedStatement\r
+    each one throwing a SQLException\r
+       with the name of the method. A concrete subclass can then just implement\r
+       the methods not implemented here and override any methods it needs\r
+       to implement for correct functionality.\r
+\r
+ */\r
+public abstract class UpdatableVTITemplate implements PreparedStatement \r
+{\r
+       protected UpdatableVTITemplate() {}\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public ResultSet executeQuery(String sql) throws SQLException\r
+       {\r
+        throw new SQLException("executeQuery");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int executeUpdate(String sql) throws SQLException\r
+       {\r
+        throw new SQLException("executeUpdate");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void close() throws SQLException\r
+       {\r
+        throw new SQLException("close");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public SQLWarning getWarnings() throws SQLException\r
+       {\r
+        throw new SQLException("getWarnings");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void clearWarnings() throws SQLException\r
+       {\r
+        throw new SQLException("clearWarnings");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int getMaxFieldSize() throws SQLException\r
+       {\r
+        throw new SQLException("getMaxFieldSize");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setMaxFieldSize(int max) throws SQLException\r
+       {\r
+        throw new SQLException("setMaxFieldSize");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int getMaxRows() throws SQLException\r
+       {\r
+        throw new SQLException("getMaxRows");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setMaxRows(int max) throws SQLException\r
+       {\r
+        throw new SQLException("setMaxRows");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setEscapeProcessing(boolean enable) throws SQLException\r
+       {\r
+        throw new SQLException("setEscapeProcessing");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int getQueryTimeout() throws SQLException\r
+       {\r
+        throw new SQLException("getQueryTimeout");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setQueryTimeout(int seconds) throws SQLException\r
+       {\r
+        throw new SQLException("setQueryTimeout");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void addBatch(String sql) throws SQLException\r
+       {\r
+        throw new SQLException("addBatch");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void clearBatch() throws SQLException\r
+       {\r
+        throw new SQLException("clearBatch");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int[] executeBatch() throws SQLException\r
+       {\r
+        throw new SQLException("executeBatch");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void cancel() throws SQLException\r
+       {\r
+        throw new SQLException("cancel");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setCursorName(String name) throws SQLException\r
+       {\r
+        throw new SQLException("setCursorName");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public boolean execute(String sql) throws SQLException\r
+       {\r
+        throw new SQLException("execute");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public ResultSet getResultSet() throws SQLException\r
+       {\r
+        throw new SQLException("getResultSet");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int getUpdateCount() throws SQLException\r
+       {\r
+        throw new SQLException("getUpdateCount");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public boolean getMoreResults() throws SQLException\r
+       {\r
+        throw new SQLException("getMoreResults");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.Statement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int getResultSetConcurrency() throws SQLException\r
+       {\r
+        return JDBC20Translation.CONCUR_UPDATABLE;\r
+       }\r
+\r
+    //\r
+    // java.sql.PreparedStatement calls, passed through to our preparedStatement.\r
+    //\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public ResultSet executeQuery() throws SQLException\r
+       {\r
+        throw new SQLException("executeQuery");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public int executeUpdate() throws SQLException\r
+       {\r
+        throw new SQLException("executeUpdate");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setNull(int parameterIndex, int jdbcType) throws SQLException\r
+       {\r
+        throw new SQLException("setNull");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setNull(int parameterIndex, int jdbcType, String typeName) throws SQLException\r
+       {\r
+        throw new SQLException("setNull");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setBoolean(int parameterIndex, boolean x) throws SQLException\r
+       {\r
+        throw new SQLException("setBoolean");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setByte(int parameterIndex, byte x) throws SQLException\r
+       {\r
+        throw new SQLException("setByte");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setShort(int parameterIndex, short x) throws SQLException\r
+       {\r
+        throw new SQLException("setShort");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setInt(int parameterIndex, int x) throws SQLException\r
+       {\r
+        throw new SQLException("setInt");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setLong(int parameterIndex, long x) throws SQLException\r
+       {\r
+        throw new SQLException("setLong");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setFloat(int parameterIndex, float x) throws SQLException\r
+       {\r
+        throw new SQLException("setFloat");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setDouble(int parameterIndex, double x) throws SQLException\r
+       {\r
+        throw new SQLException("setDouble");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException\r
+       {\r
+        throw new SQLException("setBigDecimal");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setString(int parameterIndex, String x) throws SQLException\r
+       {\r
+        throw new SQLException("setString");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setBytes(int parameterIndex, byte x[]) throws SQLException\r
+       {\r
+        throw new SQLException("setBytes");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setDate(int parameterIndex, Date x) throws SQLException\r
+       {\r
+        throw new SQLException("setDate");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setTime(int parameterIndex, Time x) throws SQLException\r
+       {\r
+        throw new SQLException("setTime");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException\r
+       {\r
+        throw new SQLException("setTimestamp");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException\r
+       {\r
+        throw new SQLException("setAsciiStream");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException\r
+       {\r
+        throw new SQLException("setUnicodeStream");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException\r
+       {\r
+        throw new SQLException("setBinaryStream");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void clearParameters() throws SQLException\r
+       {\r
+        throw new SQLException("clearParameters");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setObject(int parameterIndex, Object x, int targetJdbcType, int scale) throws SQLException\r
+       {\r
+        throw new SQLException("setObject");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setObject(int parameterIndex, Object x, int targetJdbcType) throws SQLException\r
+       {\r
+        throw new SQLException("setObject");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public void setObject(int parameterIndex, Object x) throws SQLException\r
+       {\r
+        throw new SQLException("setObject");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public boolean execute() throws SQLException\r
+       {\r
+        throw new SQLException("execute");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException on unexpected JDBC error\r
+        */\r
+       public ResultSetMetaData getMetaData() throws SQLException\r
+       {\r
+        throw new SQLException("ResultSetMetaData");\r
+       }\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public int getResultSetType() throws SQLException {\r
+               throw new SQLException("getResultSetType");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setBlob(int i, Blob x) throws SQLException {\r
+               throw new SQLException("setBlob");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setFetchDirection(int direction) throws SQLException {\r
+               throw new SQLException("setFetchDirection");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setFetchSize(int rows) throws SQLException {\r
+               throw new SQLException("setFetchSize");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void addBatch() throws SQLException {\r
+               throw new SQLException("addBatch");\r
+       }\r
+\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setCharacterStream(int parameterIndex,\r
+                                                                       Reader reader,\r
+                                                                       int length) throws SQLException {\r
+               throw new SQLException("setCharacterStream");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public Connection getConnection() throws SQLException {\r
+               throw new SQLException("getConnection");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public int getFetchDirection() throws SQLException {\r
+               throw new SQLException("getFetchDirection");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setTime(int parameterIndex, Time x, Calendar cal)\r
+                                                               throws SQLException {\r
+               throw new SQLException("setTime");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal)\r
+                                                               throws SQLException {\r
+               throw new SQLException("setTimestamp");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public int getFetchSize() throws SQLException {\r
+               throw new SQLException("getFetchSize");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setRef(int i, Ref x) throws SQLException {\r
+               throw new SQLException("setRef");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setDate(int parameterIndex, Date x, Calendar cal)\r
+                                               throws SQLException {\r
+               throw new SQLException("setDate");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setClob(int i, Clob x) throws SQLException {\r
+               throw new SQLException("setClob");\r
+       }\r
+\r
+       /**\r
+        * @see java.sql.PreparedStatement\r
+        *\r
+        * @exception SQLException              Always thrown\r
+        */\r
+       public void setArray(int i, Array x) throws SQLException {\r
+               throw new SQLException("setArray");\r
+       }\r
+\r
+    public void setURL(int arg0, URL arg1) throws SQLException {\r
+        throw new SQLException("setURL");    \r
+    }\r
+\r
+    public boolean getMoreResults(int arg0) throws SQLException {\r
+        throw new SQLException("getMoreResults");\r
+    }\r
+\r
+    public ResultSet getGeneratedKeys() throws SQLException {\r
+        throw new SQLException("getGeneratedKeys");\r
+    }\r
+\r
+    public int executeUpdate(String arg0, int arg1) throws SQLException {\r
+        throw new SQLException("executeUpdate");\r
+    }\r
+\r
+    public int executeUpdate(String arg0, int[] arg1) throws SQLException {\r
+        throw new SQLException("executeUpdate");\r
+    }\r
+\r
+    public int executeUpdate(String arg0, String[] arg1) throws SQLException {\r
+        throw new SQLException("executeUpdate");\r
+    }\r
+\r
+    public boolean execute(String arg0, int arg1) throws SQLException {\r
+        throw new SQLException("execute");\r
+    }\r
+\r
+    public boolean execute(String arg0, int[] arg1) throws SQLException {\r
+        throw new SQLException("execute");\r
+    }\r
+\r
+    public boolean execute(String arg0, String[] arg1) throws SQLException {\r
+        throw new SQLException("execute");\r
+    }\r
+\r
+    public int getResultSetHoldability() throws SQLException {\r
+        throw new SQLException("getResultSetHoldability");\r
+    }\r
+\r
+    public ParameterMetaData getParameterMetaData() throws SQLException {\r
+        throw new SQLException("getParameterMetaData");\r
+    }\r
+}\r