db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1492544 - in /db/derby/code/trunk/java: drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/jdbc/ engine/org/apache/derby/impl/jdbc/ engine/org/apache/derby/jdbc/ testing/org/apache/derbyTesting/functionTests/tests/jdbc4/
Date Thu, 13 Jun 2013 07:07:28 GMT
Author: kahatlen
Date: Thu Jun 13 07:07:27 2013
New Revision: 1492544

URL: http://svn.apache.org/r1492544
Log:
DERBY-1984: Re-factor JDBC classes to remove support for JDBC 2

Collapsed sub-classes of EmbedStatement by moving functionality
to the base class and removing specialized sub-classes for
JDBC 2.0, JDBC 3.0 and JDBC 4.0.

Added:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java   (contents, props changed)
      - copied, changed from r1492393, db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement40.java
Removed:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement20.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement30.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement20.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement30.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement40.java
Modified:
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
    db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java Thu Jun 13 07:07:27 2013
@@ -9432,8 +9432,6 @@ class DRDAConnThread extends Thread {
                                          String encoding)
            throws IOException, SQLException {
         PreparedStatement ps = stmt.getPreparedStatement();
-        EnginePreparedStatement engnps = 
-            ( EnginePreparedStatement ) ps;
         
         // DERBY-3085. Save the stream so it can be drained later
         // if not  used.
@@ -9450,7 +9448,7 @@ class DRDAConnThread extends Thread {
             new InputStreamReader( is,
                                    encoding ) ;
         
-        engnps.setCharacterStream(i, streamReader);
+        ps.setCharacterStream(i, streamReader);
     }
 
     /**
@@ -9485,7 +9483,7 @@ class DRDAConnThread extends Thread {
                 ps.setBinaryStream(index, stream, length);
 
             } else {
-                ((EnginePreparedStatement)ps).setBinaryStream(index, stream);
+                ps.setBinaryStream(index, stream);
             }
         } else {
             if (stream == null) {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java Thu Jun 13 07:07:27 2013
@@ -31,7 +31,7 @@ import java.sql.SQLException;
 import java.sql.SQLXML;
 
 public class BrokeredCallableStatement40 extends BrokeredCallableStatement
-        implements EngineCallableStatement40 {
+        implements EngineCallableStatement {
     
     public BrokeredCallableStatement40(BrokeredStatementControl control, String sql) throws SQLException{
         super(control, sql);
@@ -392,14 +392,14 @@ public class BrokeredCallableStatement40
     public <T> T getObject( int parameterIndex, Class<T> type )
         throws SQLException
     {
-        return ((EngineCallableStatement40) getCallableStatement())
+        return ((EngineCallableStatement) getCallableStatement())
                 .getObject(parameterIndex, type);
     }
     
     public <T> T getObject(String parameterName, Class<T> type)
         throws SQLException
     {
-        return ((EngineCallableStatement40) getCallableStatement())
+        return ((EngineCallableStatement) getCallableStatement())
                 .getObject(parameterName, type);
     }
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredPreparedStatement.java Thu Jun 13 07:07:27 2013
@@ -509,16 +509,11 @@ public abstract class BrokeredPreparedSt
         return engnps.executeLargeUpdate();
     }    
     
-    // JDBC 4.0 methods exposed via the EnginePreparedStatement interface
-    
     public void setBinaryStream(int parameterIndex, 
                                 InputStream x)
         throws SQLException {
-        
-        final EnginePreparedStatement engnps = 
-            (EnginePreparedStatement) getPreparedStatement();  
 
-        engnps.setBinaryStream(parameterIndex, x);
+        getPreparedStatement().setBinaryStream(parameterIndex, x);
 
     }
     
@@ -526,12 +521,9 @@ public abstract class BrokeredPreparedSt
     public void setCharacterStream(int parameterIndex, 
                                    Reader reader)
         throws SQLException{
-        
-        final EnginePreparedStatement engnps = 
-            (EnginePreparedStatement) getPreparedStatement();  
 
-        engnps.setCharacterStream(parameterIndex, reader);
-        
+        getPreparedStatement().setCharacterStream(parameterIndex, reader);
+
     }
 
     // JDBC 3.0 methods

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredStatement.java Thu Jun 13 07:07:27 2013
@@ -432,7 +432,7 @@ public abstract class BrokeredStatement 
      */
 	public final boolean getMoreResults(int current) throws SQLException
     {
-        return ((EngineStatement) getStatement()).getMoreResults( current);
+        return getStatement().getMoreResults(current);
 	}
 
     /**
@@ -462,8 +462,7 @@ public abstract class BrokeredStatement 
 	public final int getResultSetHoldability()
         throws SQLException
 	{
-        int holdability =
-            ((EngineStatement) getStatement()).getResultSetHoldability();
+        int holdability = getStatement().getResultSetHoldability();
         
         // Holdability might be downgraded.
         return controlCheck().checkHoldCursors(holdability);
@@ -570,7 +569,7 @@ public abstract class BrokeredStatement 
      * @exception SQLException if an error occurs
      */
     public final boolean isClosed() throws SQLException {
-        return ((EngineStatement) getStatement()).isClosed();
+        return getStatement().isClosed();
     }
 
     /**

Copied: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java (from r1492393, db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement40.java)
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java?p2=db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java&p1=db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement40.java&r1=1492393&r2=1492544&rev=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java Thu Jun 13 07:07:27 2013
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.iapi.jdbc.EngineCallableStatement40
+   Derby - Class org.apache.derby.iapi.jdbc.EngineCallableStatement
 
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -27,7 +27,7 @@ import java.sql.SQLException;
  * Additional methods the engine exposes on its CallableStatement object
  * implementations, whose signatures are not compatible with older platforms.
  */
-public interface EngineCallableStatement40
+public interface EngineCallableStatement
         extends EngineStatement, CallableStatement {
     // JDBC 4.1 methods that use generics and won't compile on CDC.
     <T> T getObject(int parameterIndex, Class<T> type) throws SQLException;

Propchange: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineCallableStatement.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EnginePreparedStatement.java Thu Jun 13 07:07:27 2013
@@ -20,8 +20,6 @@
  */
 package org.apache.derby.iapi.jdbc;
 
-import java.io.InputStream;
-import java.io.Reader;
 import java.sql.SQLException;
 import java.sql.PreparedStatement;
 
@@ -34,12 +32,6 @@ import java.sql.PreparedStatement;
  */
 public interface EnginePreparedStatement extends PreparedStatement, EngineStatement {
     
-    public void setBinaryStream(int parameterIndex, InputStream x)
-        throws SQLException; 
-    
-    public void setCharacterStream(int parameterIndex, Reader reader)
-        throws SQLException;
-
     /**
      * Get the version of the prepared statement. If this has not been changed,
      * the caller may assume that a recompilation has not taken place, i.e.

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/EngineStatement.java Thu Jun 13 07:07:27 2013
@@ -32,26 +32,7 @@ import java.sql.Statement;
  * 
  */
 public interface EngineStatement extends Statement {
-    
-    /**
-     * Identical to the JDBC 3 getMoreResults(int).
-     * 
-     * @see java.sql.Statement#getMoreResults(int)
-     */
-    public boolean getMoreResults(int current) throws SQLException;
-    
-    /**
-     * Identical to the JDBC 3 getResultSetHoldability(int).
-     * 
-     * @see java.sql.Statement#getResultSetHoldability()
-     */ 
-    public int getResultSetHoldability() throws SQLException;
 
-    /**
-     * Identical to the JDBC 4 isClosed() method.
-     */
-    public boolean isClosed() throws SQLException;
-    
     ////////////////////////////////////////////////////////////////////
     //
     // INTRODUCED BY JDBC 4.1 IN JAVA 7

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement.java Thu Jun 13 07:07:27 2013
@@ -21,6 +21,12 @@
 
 package org.apache.derby.impl.jdbc;
 
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.io.StringReader;
+import java.io.UnsupportedEncodingException;
 import org.apache.derby.iapi.sql.ParameterValueSet;
 import org.apache.derby.iapi.sql.Activation;
 import org.apache.derby.iapi.error.StandardException;
@@ -32,23 +38,33 @@ import org.apache.derby.iapi.reference.S
 
 import java.math.BigDecimal;
 import java.net.URL;
+import java.sql.Array;
 import java.sql.Blob;
 import java.sql.CallableStatement;
 import java.sql.Clob;
 import java.sql.SQLException;
 import java.sql.Date;
+import java.sql.NClob;
 import java.sql.ParameterMetaData;
+import java.sql.Ref;
+import java.sql.RowId;
+import java.sql.SQLXML;
 import java.sql.Statement;
 import java.sql.Time;
 import java.sql.Timestamp;
+import java.sql.Types;
 import java.util.Calendar;
+import java.util.Map;
+import org.apache.derby.iapi.jdbc.CharacterStreamDescriptor;
+import org.apache.derby.iapi.jdbc.EngineCallableStatement;
+import org.apache.derby.iapi.types.StringDataValue;
 
 /**
  * Local implementation.
  *
  */
-public abstract class EmbedCallableStatement extends EmbedPreparedStatement
-	implements CallableStatement
+public class EmbedCallableStatement extends EmbedPreparedStatement
+    implements EngineCallableStatement
 {
 	/*
 	** True if we are of the form ? = CALL() -- i.e. true
@@ -667,5 +683,1228 @@ public abstract class EmbedCallableState
 
 		super.addBatch();
 	}
+
+    /**
+     * JDBC 2.0
+     *
+     * Returns an object representing the value of OUT parameter {@code i}.
+     * Use the map to determine the class from which to construct data of SQL
+     * structured and distinct types.
+     *
+     * @param i the first parameter is 1, the second is 2, ...
+     * @param map the mapping from SQL type names to Java classes
+     * @return a java.lang.Object holding the OUT parameter value.
+     * @exception SQLException if a database-access error occurs.
+     */
+    public final Object getObject(int i, Map<String, Class<?>> map) throws SQLException {
+        checkStatus();
+        if (map == null) {
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER, map, "map",
+                    "java.sql.CallableStatement.getObject");
+        }
+        if (!map.isEmpty()) {
+            throw Util.notImplemented();
+        }
+        // Map is empty call the normal getObject method.
+        return getObject(i);
+    }
+
+    /**
+     * JDBC 2.0
+     *
+     * Get a REF(&lt;structured-type&gt;) OUT parameter.
+     *
+     * @param i the first parameter is 1, the second is 2, ...
+     * @return an object representing data of an SQL REF Type
+     * @exception SQLException if a database-access error occurs.
+     */
+    public final Ref getRef(int i) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 2.0
+     *
+     * Get an Array OUT parameter.
+     *
+     * @param i the first parameter is 1, the second is 2, ...
+     * @return an object representing an SQL array
+     * @exception SQLException if a database-access error occurs.
+     */
+    public final Array getArray(int i) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    // JDBC 3.0 methods
+
+    /**
+     * JDBC 3.0
+     *
+     * Registers the OUT parameter named parameterName to the JDBC type sqlType.
+     * All OUT parameters must be registered before a stored procedure is
+     * executed.
+     *
+     * @param parameterName - the name of the parameter
+     * @param sqlType - the JDBC type code defined by java.sql.Types. If the
+     * parameter is of JDBC type NUMERIC or DECIMAL, the version of
+     * registerOutParameter that accepts a scale value should be used.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void registerOutParameter(String parameterName, int sqlType)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Registers the designated output parameter. This version of the method
+     * registerOutParameter should be used for a user-named or REF output
+     * parameter.
+     *
+     * @param parameterName - the name of the parameter
+     * @param sqlType - the SQL type code defined by java.sql.Types.
+     * @param typeName - the fully-qualified name of an SQL structure type
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void registerOutParameter(String parameterName,
+            int sqlType, String typeName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Registers the parameter named parameterName to the JDBC type sqlType.
+     * This method must be called before a stored procedure is executed.
+     *
+     * @param parameterName - the name of the parameter
+     * @param sqlType - the SQL type code defined by java.sql.Types.
+     * @param scale - the desired number of digits to the right of the decimal
+     * point. It must be greater than or equal to zero.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void registerOutParameter(String parameterName,
+            int sqlType, int scale) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC REF (<structured-type) parameter as a Ref
+     * object in the Java programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value as a Ref object in the Java Programming
+     * language. If the value is SQL NULL, the result is null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Ref getRef(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC BLOB parameter as a Blob object in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value as a Blob object in the Java Programming
+     * language. If the value is SQL NULL, the result is null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Blob getBlob(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC CLOB parameter as a Clob object in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value as a Clob object in the Java Programming
+     * language. If the value is SQL NULL, the result is null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Clob getClob(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC ARRAY parameter as an Array object in the
+     * Java programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value as a Array object in the Java Programming
+     * language. If the value is SQL NULL, the result is null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Array getArray(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to SQL NULL.
+     *
+     * @param parameterName - the name of the parameter
+     * @param sqlType - the SQL type code defined in java.sql.Types
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setNull(String parameterName, int sqlType)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to SQL NULL.
+     *
+     * @param parameterName - the name of the parameter
+     * @param sqlType - the SQL type code defined in java.sql.Types
+     * @param typeName - the fully-qualified name of an SQL user-defined type
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setNull(String parameterName, int sqlType, String typeName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java boolean value. The driver
+     * converts this to an SQL BIT value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setBoolean(String parameterName, boolean x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC BIT parameter as a boolean in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * false.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final boolean getBoolean(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java byte value. The driver
+     * converts this to an SQL TINYINT value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setByte(String parameterName, byte x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC TINYINT parameter as a byte in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final byte getByte(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java short value. The driver
+     * converts this to an SQL SMALLINT value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setShort(String parameterName, short x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC SMALLINT parameter as a short in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final short getShort(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java int value. The driver
+     * converts this to an SQL INTEGER value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setInt(String parameterName, int x) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC INTEGER parameter as a int in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final int getInt(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java long value. The driver
+     * converts this to an SQL BIGINT value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setLong(String parameterName, long x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC BIGINT parameter as a long in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final long getLong(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java float value. The driver
+     * converts this to an SQL FLOAT value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setFloat(String parameterName, float x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC FLOAT parameter as a float in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final float getFloat(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java double value. The driver
+     * converts this to an SQL DOUBLE value when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setDouble(String parameterName, double x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC DOUBLE parameter as a double in the Java
+     * programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final double getDouble(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.math.BigDecimal value.
+     * The driver converts this to an SQL NUMERIC value when it sends it to the
+     * database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setBigDecimal(String parameterName, BigDecimal x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC NUMERIC parameter as a java.math.BigDecimal
+     * object with as many digits to the right of the decimal point as the value
+     * contains
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is 0.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final BigDecimal getBigDecimal(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java String value. The driver
+     * converts this to an SQL VARCHAR OR LONGVARCHAR value (depending on the
+     * argument's size relative the driver's limits on VARCHAR values) when it
+     * sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setString(String parameterName, String x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC CHAR, VARCHAR, or LONGVARCHAR parameter as
+     * a String in the Java programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final String getString(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Java array of bytes. The
+     * driver converts this to an SQL VARBINARY OR LONGVARBINARY (depending on
+     * the argument's size relative to the driver's limits on VARBINARY
+     * values)when it sends it to the database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setBytes(String parameterName, byte[] x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC BINARY or VARBINARY parameter as an array
+     * of byte values in the Java programming language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final byte[] getBytes(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Date value. The
+     * driver converts this to an SQL DATE value when it sends it to the
+     * database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setDate(String parameterName, Date x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Date value, using the
+     * given Calendar object.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @param cal - the Calendar object the driver will use to construct the
+     * date
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setDate(String parameterName, Date x, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC DATE parameter as a java.sql.Date object
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Date getDate(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC DATE parameter as a java.sql.Date object,
+     * using the given Calendar object to construct the date object.
+     *
+     * @param parameterName - the name of the parameter
+     * @param cal - the Calendar object the driver will use to construct the
+     * date
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Date getDate(String parameterName, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Time value. The
+     * driver converts this to an SQL TIME value when it sends it to the
+     * database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setTime(String parameterName, Time x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC TIME parameter as ajava.sql.Time object
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Time getTime(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC TIME parameter as a java.sql.Time object,
+     * using the given Calendar object to construct the time object.
+     *
+     * @param parameterName - the name of the parameter
+     * @param cal - the Calendar object the driver will use to construct the
+     * time
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Time getTime(String parameterName, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Time value using the
+     * Calendar object
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @param cal - the Calendar object the driver will use to construct the
+     * time
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setTime(String parameterName, Time x, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Timestamp value. The
+     * driver converts this to an SQL TIMESTAMP value when it sends it to the
+     * database.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setTimestamp(String parameterName, Timestamp x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given java.sql.Timestamp value,
+     * using the given Calendar object
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the parameter value
+     * @param cal - the Calendar object the driver will use to construct the
+     * timestamp.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setTimestamp(String parameterName, Timestamp x, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp
+     * object
+     *
+     * @param parameterName - the name of the parameter
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Timestamp getTimestamp(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a JDBC TIMESTAMP parameter as a java.sql.Timestamp
+     * object, using the given Calendar object to construct the Timestamp
+     * object.
+     *
+     * @param parameterName - the name of the parameter
+     * @param cal - the Calendar object the driver will use to construct the
+     * Timestamp
+     * @return the parameter value. If the value is SQL NULL, the result is
+     * null.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Timestamp getTimestamp(String parameterName, Calendar cal)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given input stream, which will have
+     * the specified number of bytes.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the Java input stream that contains the ASCII parameter value
+     * @param length - the number of bytes in the stream
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setAsciiStream(String parameterName, InputStream x, int length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given input stream, which will have
+     * the specified number of bytes.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the Java input stream that contains the binary parameter value
+     * @param length - the number of bytes in the stream
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setBinaryStream(String parameterName, InputStream x, int length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the designated parameter to the given Reader object, which is the
+     * given number of characters long.
+     *
+     * @param parameterName - the name of the parameter
+     * @param reader - the java.io.Reader object that contains the UNICODE data
+     * @param length - the number of characters in the stream
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setCharacterStream(String parameterName, Reader reader, int length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the value of the designated parameter with the given object. The
+     * second argument must be an object type; for integral values, the
+     * java.lang equivalent objects should be used.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the object containing the input parameter value
+     * @param targetSqlType - the SQL type (as defined in java.sql.Types) to be
+     * sent to the database. The scale argument may further qualify this type.
+     * @param scale - for java.sql.Types.DECIMAL or java.sql.Types.NUMERIC
+     * types, this is the number of digits after the decimal point. For all
+     * other types, this value will be ignored.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setObject(String parameterName, Object x, int targetSqlType, int scale)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the value of a parameter as an Object in the java programming
+     * language.
+     *
+     * @param parameterName - the name of the parameter
+     * @return a java.lang.Object holding the OUT parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Object getObject(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Returns an object representing the value of OUT parameter i and uses map
+     * for the custom mapping of the parameter value.
+     *
+     * @param parameterName - the name of the parameter
+     * @param map - the mapping from SQL type names to Java classes
+     * @return a java.lang.Object holding the OUT parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final Object getObject(String parameterName, Map<String, Class<?>> map)
+            throws SQLException {
+        checkStatus();
+        if (map == null) {
+            throw Util.generateCsSQLException(SQLState.INVALID_API_PARAMETER, map, "map",
+                    "java.sql.CallableStatement.getObject");
+        }
+        if (!(map.isEmpty())) {
+            throw Util.notImplemented();
+        }
+
+        // Map is empty so call the normal getObject method.
+        return getObject(parameterName);
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the value of the designated parameter with the given object. This
+     * method is like the method setObject above, except that it assumes a scale
+     * of zero.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the object containing the input parameter value
+     * @param targetSqlType - the SQL type (as defined in java.sql.Types) to be
+     * sent to the database.
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setObject(String parameterName, Object x, int targetSqlType)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 3.0
+     *
+     * Sets the value of the designated parameter with the given object. The
+     * second parameter must be of type Object; therefore, the java.lang
+     * equivalent objects should be used for built-in types.
+     *
+     * @param parameterName - the name of the parameter
+     * @param x - the object containing the input parameter value
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setObject(String parameterName, Object x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    // JDBC 4.0 methods
+
+    /**
+     * Retrieves the value of the designated parameter as a
+     * <code>java.io.Reader</code> object in the Java programming language.
+     * Introduced in JDBC 4.0.
+     *
+     * @param parameterIndex the first parameter is 1, the second is 2, ...
+     * @return a <code>java.io.Reader</code> object that contains the parameter
+     * value; if the value is SQL <code>NULL</code>, the value returned
+     * is <code>null</code> in the Java programming language.
+     * @throws SQLException if a database access error occurs or this method is
+     * called on a closed <code>CallableStatement</code>
+     */
+    public final Reader getCharacterStream(int parameterIndex)
+            throws SQLException {
+        checkStatus();
+        // Make sure the specified parameter has mode OUT or IN/OUT.
+        switch (getParms().getParameterMode(parameterIndex)) {
+            case (ParameterMetaData.parameterModeIn):
+            case (ParameterMetaData.parameterModeUnknown):
+                throw newSQLException(SQLState.LANG_NOT_OUTPUT_PARAMETER,
+                        Integer.toString(parameterIndex));
+        }
+        Reader reader = null;
+        int paramType = getParameterJDBCType(parameterIndex);
+        switch (paramType) {
+            // Handle character/string types.
+            case Types.CHAR:
+            case Types.VARCHAR:
+            case Types.LONGVARCHAR:
+            case Types.CLOB:
+                boolean pushStack = false;
+                Object syncObject = getConnectionSynchronization();
+                synchronized (syncObject) {
+                    try {
+                        StringDataValue param = (StringDataValue) getParms().getParameterForGet(parameterIndex - 1);
+                        if (param.isNull()) {
+                            break;
+                        }
+                        pushStack = true;
+                        setupContextStack();
+
+                        if (param.hasStream()) {
+                            CharacterStreamDescriptor csd =
+                                    param.getStreamWithDescriptor();
+                            reader = new UTF8Reader(csd, this, syncObject);
+                        } else {
+                            reader = new StringReader(param.getString());
+                        }
+                    } catch (Throwable t) {
+                        throw EmbedResultSet.noStateChangeException(t);
+                    } finally {
+                        if (pushStack) {
+                            restoreContextStack();
+                        }
+                    }
+                } // End synchronized block
+                break;
+
+            // Handle binary types.
+            // JDBC says to support these, but no defintion exists for the output.
+            // Match JCC which treats the bytes as a UTF-16BE stream.
+            case Types.BINARY:
+            case Types.VARBINARY:
+            case Types.LONGVARBINARY:
+            case Types.BLOB:
+                try {
+                    InputStream is = getBinaryStream(parameterIndex);
+                    if (is != null) {
+                        reader = new InputStreamReader(is, "UTF-16BE");
+                    }
+                    break;
+                } catch (UnsupportedEncodingException uee) {
+                    throw newSQLException(uee.getMessage());
+                }
+
+            default:
+                throw newSQLException(SQLState.LANG_DATA_TYPE_GET_MISMATCH,
+                        "java.io.Reader", Util.typeName(paramType));
+        }
+        // Update wasNull.
+        wasNull = (reader == null);
+        return reader;
+    }
+
+    /**
+     * Get binary stream for a parameter.
+     *
+     * @param parameterIndex first parameter is 1, second is 2 etc.
+     * @return a stream for the binary parameter, or <code>null</code>.
+     *
+     * @throws SQLException if a database access error occurs.
+     */
+    private InputStream getBinaryStream(int parameterIndex)
+            throws SQLException {
+        int paramType = getParameterJDBCType(parameterIndex);
+        switch (paramType) {
+            case Types.BINARY:
+            case Types.VARBINARY:
+            case Types.LONGVARBINARY:
+            case Types.BLOB:
+                break;
+            default:
+                throw newSQLException(SQLState.LANG_DATA_TYPE_GET_MISMATCH,
+                        "java.io.InputStream", Util.typeName(paramType));
+        }
+
+        boolean pushStack = false;
+        synchronized (getConnectionSynchronization()) {
+            try {
+                DataValueDescriptor param =
+                        getParms().getParameterForGet(parameterIndex - 1);
+                wasNull = param.isNull();
+                if (wasNull) {
+                    return null;
+                }
+                pushStack = true;
+                setupContextStack();
+
+                InputStream stream; // The stream we will return to the user
+                if (param.hasStream()) {
+                    stream = new BinaryToRawStream(param.getStream(), param);
+                } else {
+                    stream = new ByteArrayInputStream(param.getBytes());
+                }
+                return stream;
+            } catch (Throwable t) {
+                throw EmbedResultSet.noStateChangeException(t);
+            } finally {
+                if (pushStack) {
+                    restoreContextStack();
+                }
+            }
+        } // End synchronized block
+    }
+
+    public final Reader getCharacterStream(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final Reader getNCharacterStream(int parameterIndex)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final Reader getNCharacterStream(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final String getNString(int parameterIndex)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final String getNString(String parameterName)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setBlob(String parameterName, Blob x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setClob(String parameterName, Clob x)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final RowId getRowId(int parameterIndex) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final RowId getRowId(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setRowId(String parameterName, RowId x) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNString(String parameterName, String value)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNCharacterStream(String parameterName, Reader value, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNClob(String parameterName, NClob value) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setClob(String parameterName, Reader reader, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+
+    }
+
+    public final void setBlob(String parameterName, InputStream inputStream, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNClob(String parameterName, Reader reader, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final NClob getNClob(int i) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final NClob getNClob(String parameterName) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setSQLXML(String parameterName, SQLXML xmlObject) throws SQLException {
+        throw Util.notImplemented();
+
+    }
+
+    public final SQLXML getSQLXML(int parameterIndex) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final SQLXML getSQLXML(String parametername) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setAsciiStream(String parameterName, InputStream x)
+            throws SQLException {
+        throw Util.notImplemented("setAsciiStream(String,InputStream)");
+    }
+
+    public final void setBinaryStream(String parameterName, InputStream x)
+            throws SQLException {
+        throw Util.notImplemented("setBinaryStream(String,InputStream)");
+    }
+
+    public final void setBlob(String parameterName, InputStream inputStream)
+            throws SQLException {
+        throw Util.notImplemented("setBlob(String,InputStream)");
+    }
+
+    public final void setCharacterStream(String parameterName, Reader reader)
+            throws SQLException {
+        throw Util.notImplemented("setCharacterStream(String,Reader)");
+    }
+
+    public final void setClob(String parameterName, Reader reader)
+            throws SQLException {
+        throw Util.notImplemented("setClob(String,Reader)");
+    }
+
+    public final void setNCharacterStream(String parameterName, Reader value)
+            throws SQLException {
+        throw Util.notImplemented("setNCharacterStream(String,Reader)");
+    }
+
+    public final void setNClob(String parameterName, Reader reader)
+            throws SQLException {
+        throw Util.notImplemented("setNClob(String,Reader)");
+    }
+
+    /**
+     * Sets the designated parameter to the given input stream, which will have
+     * the specified number of bytes.
+     *
+     * @param parameterName the name of the first parameter
+     * @param x the java input stream which contains the ASCII parameter value
+     * @param length the number of bytes in the stream
+     * @exception SQLException thrown on failure.
+     *
+     */
+    public final void setAsciiStream(String parameterName, InputStream x, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * Sets the designated parameter to the given input stream, which will have
+     * the specified number of bytes.
+     *
+     * @param parameterName the name of the first parameter
+     * @param x the java input stream which contains the binary parameter value
+     * @param length the number of bytes in the stream
+     * @exception SQLException thrown on failure.
+     *
+     */
+    public final void setBinaryStream(String parameterName, InputStream x, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * Sets the designated parameter to the given Reader, which will have the
+     * specified number of bytes.
+     *
+     * @param parameterName the name of the first parameter
+     * @param x the java Reader which contains the UNICODE value
+     * @param length the number of bytes in the stream
+     * @exception SQLException thrown on failure.
+     *
+     */
+    public final void setCharacterStream(String parameterName, Reader x, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    ////////////////////////////////////////////////////////////////////
+    //
+    // INTRODUCED BY JDBC 4.1 IN JAVA 7
+    //
+    ////////////////////////////////////////////////////////////////////
+    public final <T> T getObject(int parameterIndex, Class<T> type)
+            throws SQLException {
+        checkStatus();
+
+        if (type == null) {
+            throw mismatchException("NULL", parameterIndex);
+        }
+
+        Object retval;
+
+        if (String.class.equals(type)) {
+            retval = getString(parameterIndex);
+        } else if (BigDecimal.class.equals(type)) {
+            retval = getBigDecimal(parameterIndex);
+        } else if (Boolean.class.equals(type)) {
+            retval = getBoolean(parameterIndex);
+        } else if (Byte.class.equals(type)) {
+            retval = getByte(parameterIndex);
+        } else if (Short.class.equals(type)) {
+            retval = getShort(parameterIndex);
+        } else if (Integer.class.equals(type)) {
+            retval = getInt(parameterIndex);
+        } else if (Long.class.equals(type)) {
+            retval = getLong(parameterIndex);
+        } else if (Float.class.equals(type)) {
+            retval = getFloat(parameterIndex);
+        } else if (Double.class.equals(type)) {
+            retval = getDouble(parameterIndex);
+        } else if (Date.class.equals(type)) {
+            retval = getDate(parameterIndex);
+        } else if (Time.class.equals(type)) {
+            retval = getTime(parameterIndex);
+        } else if (Timestamp.class.equals(type)) {
+            retval = getTimestamp(parameterIndex);
+        } else if (Blob.class.equals(type)) {
+            retval = getBlob(parameterIndex);
+        } else if (Clob.class.equals(type)) {
+            retval = getClob(parameterIndex);
+        } else if (type.isArray() && type.getComponentType().equals(byte.class)) {
+            retval = getBytes(parameterIndex);
+        } else {
+            retval = getObject(parameterIndex);
+        }
+
+        if (wasNull()) {
+            retval = null;
+        }
+
+        if ((retval == null) || (type.isInstance(retval))) {
+            return type.cast(retval);
+        }
+
+        throw mismatchException(type.getName(), parameterIndex);
+    }
+
+    private SQLException mismatchException(String targetTypeName, int parameterIndex)
+            throws SQLException {
+        String sourceTypeName = getParameterMetaData().getParameterTypeName(parameterIndex);
+        return newSQLException(SQLState.LANG_DATA_TYPE_GET_MISMATCH, targetTypeName, sourceTypeName);
+    }
+
+    public final <T> T getObject(String parameterName, Class<T> type)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
 }
 

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement42.java Thu Jun 13 07:07:27 2013
@@ -23,9 +23,8 @@ package org.apache.derby.impl.jdbc;
 
 import java.sql.SQLException;
 import java.sql.SQLType;
-import org.apache.derby.iapi.reference.SQLState;
 
-public class EmbedCallableStatement42 extends EmbedCallableStatement40
+public class EmbedCallableStatement42 extends EmbedCallableStatement
 {
         
     /** Creates a new instance of EmbedCallableStatement42 */

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement.java Thu Jun 13 07:07:27 2013
@@ -60,6 +60,12 @@ import java.sql.Blob;
 
 import java.io.InputStream;
 import java.io.Reader;
+import java.sql.Array;
+import java.sql.NClob;
+import java.sql.ParameterMetaData;
+import java.sql.Ref;
+import java.sql.RowId;
+import java.sql.SQLXML;
 import java.sql.Types;
 
 import org.apache.derby.iapi.jdbc.BrokeredConnectionControl;
@@ -71,15 +77,10 @@ import org.apache.derby.iapi.types.Strin
 import org.apache.derby.iapi.util.InterruptStatus;
 
 /**
- *
  * EmbedPreparedStatement is a local JDBC statement.
-  <P><B>Supports</B>
-   <UL>
-   <LI> JSR169
-   </UL>
+ * It supports JDBC 4.1.
  */
-public abstract class EmbedPreparedStatement
-	extends EmbedStatement
+public class EmbedPreparedStatement extends EmbedStatement
 	implements EnginePreparedStatement
 {
 
@@ -1166,6 +1167,32 @@ public abstract class EmbedPreparedState
 		return rMetaData;
 	}
 
+    /**
+     * JDBC 2.0
+     *
+     * Set a REF(&lt;structured-type&gt;) parameter.
+     *
+     * @param i the first parameter is 1, the second is 2, ...
+     * @param x an object representing data of an SQL REF Type
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setRef(int i, Ref x) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    /**
+     * JDBC 2.0
+     *
+     * Set an Array parameter.
+     *
+     * @param i the first parameter is 1, the second is 2, ...
+     * @param x an object representing an SQL array
+     * @exception SQLException Feature not implemented for now.
+     */
+    public final void setArray(int i, Array x) throws SQLException {
+        throw Util.notImplemented();
+    }
+
     //----------------------------------------------------------------------
     // Advanced features:
 
@@ -1660,6 +1687,24 @@ public abstract class EmbedPreparedState
 		throw Util.notImplemented();
 	}
 
+    /**
+     * JDBC 3.0
+     *
+     * Retrieves the number, types and properties of this PreparedStatement
+     * object's parameters.
+     *
+     * @return a ParameterMetaData object that contains information about the
+     * number, types and properties of this PreparedStatement object's
+     * parameters.
+     * @exception SQLException if a database access error occurs
+     */
+    public final ParameterMetaData getParameterMetaData()
+            throws SQLException {
+        checkStatus();
+        return new EmbedParameterMetaData30(
+                getParms(), preparedStatement.getParameterTypes());
+    }
+
 	//
 	// methods to be overridden in subimplementations
 	// that want to stay within their subimplementation.
@@ -1915,6 +1960,41 @@ public abstract class EmbedPreparedState
         }
     }
 
+    public final void setRowId(int parameterIndex, RowId x) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNString(int index, String value) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNCharacterStream(int parameterIndex, Reader value)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNCharacterStream(int index, Reader value, long length) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNClob(int parameterIndex, Reader reader)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNClob(int index, NClob value) throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setNClob(int parameterIndex, Reader reader, long length)
+            throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public final void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
+        throw Util.notImplemented();
+    }
+
     public final long getVersionCounter() throws SQLException {
         return preparedStatement.getVersionCounter();
     }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedPreparedStatement42.java Thu Jun 13 07:07:27 2013
@@ -21,19 +21,15 @@
 
 package org.apache.derby.impl.jdbc;
 
-import java.sql.JDBCType;
 import java.sql.SQLException;
 import java.sql.SQLType;
-import java.sql.Types;
-
-import org.apache.derby.iapi.reference.SQLState;
 
 /**
  * <p>
  * PreparedStatement methods added by JDBC 4.2 which require Java 8.
  * </p>
  */
-public class EmbedPreparedStatement42 extends EmbedPreparedStatement40
+public class EmbedPreparedStatement42 extends EmbedPreparedStatement
 {    
     public EmbedPreparedStatement42
         (

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedStatement.java Thu Jun 13 07:07:27 2013
@@ -46,19 +46,10 @@ import java.sql.ResultSet;
 */
 
 /**
- *
  * EmbedStatement is a local JDBC statement.
- *
-   <P><B>Supports</B>
-   <UL>
-   <LI> JSR169 - no subsetting for java.sql.Statement
-   <LI> JDBC 2.0
-   <LI> JDBC 3.0 - no new dependencies on new JDBC 3.0 or JDK 1.4 classes,
-        new methods can safely be added into implementation.
-   </UL>
-
+ * It supports JDBC 4.1.
  */
-public abstract class EmbedStatement extends ConnectionChild
+public class EmbedStatement extends ConnectionChild
     implements EngineStatement {
 
 	private final java.sql.Connection applicationConnection;
@@ -1874,6 +1865,37 @@ public abstract class EmbedStatement ext
 		isPoolable = poolable;
 	}
 
+    /**
+     * Returns false unless {@code interfaces} is implemented.
+     *
+     * @param interfaces a Class defining an interface.
+     * @return true if this implements the interface or directly or indirectly
+     * wraps an object that does.
+     * @throws SQLException if an error occurs while determining
+     * whether this is a wrapper for an object with the given interface.
+     */
+    public final boolean isWrapperFor(Class<?> interfaces) throws SQLException {
+        checkStatus();
+        return interfaces.isInstance(this);
+    }
+
+    /**
+     * Returns {@code this} if this class implements the interface.
+     *
+     * @param interfaces a Class defining an interface
+     * @return an object that implements the interface
+     * @throws SQLException if no object if found that implements the interface
+     */
+    public final <T> T unwrap(java.lang.Class<T> interfaces)
+            throws SQLException {
+        checkStatus();
+        try {
+            return interfaces.cast(this);
+        } catch (ClassCastException cce) {
+            throw newSQLException(SQLState.UNABLE_TO_UNWRAP, interfaces);
+        }
+    }
+
     ////////////////////////////////////////////////////////////////////
     //
     // INTRODUCED BY JDBC 4.1 IN JAVA 7

Modified: db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/jdbc/Driver40.java Thu Jun 13 07:07:27 2013
@@ -26,17 +26,16 @@ import org.apache.derby.iapi.jdbc.Broker
 import org.apache.derby.iapi.jdbc.BrokeredConnectionControl;
 import org.apache.derby.iapi.jdbc.BrokeredConnection40;
 import org.apache.derby.iapi.sql.ResultSet;
-import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.impl.jdbc.EmbedCallableStatement;
 import org.apache.derby.impl.jdbc.EmbedConnection;
-import org.apache.derby.impl.jdbc.EmbedPreparedStatement40;
-import org.apache.derby.impl.jdbc.EmbedCallableStatement40;
 import org.apache.derby.impl.jdbc.EmbedConnection40;
+import org.apache.derby.impl.jdbc.EmbedPreparedStatement;
 import org.apache.derby.impl.jdbc.EmbedResultSet;
 import org.apache.derby.impl.jdbc.EmbedResultSet40;
+import org.apache.derby.impl.jdbc.EmbedStatement;
 import org.apache.derby.impl.jdbc.EmbedDatabaseMetaData40;
 import org.apache.derby.impl.jdbc.SQLExceptionFactory40;
-import org.apache.derby.impl.jdbc.EmbedStatement40;
 import org.apache.derby.impl.jdbc.EmbedResultSetMetaData40;
 import org.apache.derby.iapi.jdbc.ResourceAdapter;
 import org.apache.derby.impl.jdbc.Util;
@@ -83,8 +82,8 @@ public class Driver40 extends Driver30 {
 				int resultSetConcurrency,
 				int resultSetHoldability)
 	{
-		return new EmbedStatement40(conn, forMetaData, resultSetType, resultSetConcurrency,
-		resultSetHoldability);
+        return new EmbedStatement(conn, forMetaData, resultSetType,
+                resultSetConcurrency, resultSetHoldability);
 	}
     
     public PreparedStatement
@@ -99,7 +98,7 @@ public class Driver40 extends Driver30 {
         int[] columnIndexes,
         String[] columnNames)
         throws SQLException {
-        return new EmbedPreparedStatement40(conn,
+        return new EmbedPreparedStatement(conn,
             stmt,
             forMetaData,
             resultSetType,
@@ -118,7 +117,7 @@ public class Driver40 extends Driver30 {
         int resultSetConcurrency,
         int resultSetHoldability)
         throws SQLException {
-        return new EmbedCallableStatement40(conn,
+        return new EmbedCallableStatement(conn,
             stmt,
             resultSetType,
             resultSetConcurrency,

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java?rev=1492544&r1=1492543&r2=1492544&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/Wrapper41.java Thu Jun 13 07:07:27 2013
@@ -26,7 +26,7 @@ import org.apache.derby.client.am.Client
 import org.apache.derby.client.am.ClientResultSet;
 import org.apache.derby.client.am.LogicalCallableStatement;
 import org.apache.derby.iapi.jdbc.BrokeredCallableStatement40;
-import org.apache.derby.impl.jdbc.EmbedCallableStatement40;
+import org.apache.derby.impl.jdbc.EmbedCallableStatement;
 import org.apache.derby.impl.jdbc.EmbedResultSet40;
 
 /**
@@ -44,7 +44,7 @@ public  class   Wrapper41
 
     private EmbedResultSet40    _embedded;
     private ClientResultSet      _netclient;
-    private EmbedCallableStatement40 _embedCallableStatement;
+    private EmbedCallableStatement _embedCallableStatement;
     private ClientCallableStatement _callableStatement;
     private BrokeredCallableStatement40 _brokeredCallableStatement;
     private LogicalCallableStatement _logicalCallableStatement;
@@ -58,7 +58,7 @@ public  class   Wrapper41
     public Wrapper41( Object wrapped ) throws Exception
     {
         if ( wrapped instanceof EmbedResultSet40 ) { _embedded = (EmbedResultSet40) wrapped; }
-        else if ( wrapped instanceof EmbedCallableStatement40 ) { _embedCallableStatement = (EmbedCallableStatement40) wrapped; }
+        else if ( wrapped instanceof EmbedCallableStatement ) { _embedCallableStatement = (EmbedCallableStatement) wrapped; }
         else if ( wrapped instanceof BrokeredCallableStatement40 ) { _brokeredCallableStatement = (BrokeredCallableStatement40) wrapped; }
         else if ( wrapped instanceof ClientResultSet ) { _netclient = (ClientResultSet) wrapped; }
         else if ( wrapped instanceof ClientCallableStatement ) { _callableStatement = (ClientCallableStatement) wrapped; }



Mime
View raw message