db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r390292 - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ engine/org/apache/derby/iapi/jdbc/ engine/org/apache/derby/impl/jdbc/ testing/org/apache/derbyTesting/functionTests/suites/ testing/org/apache/derbyTesting/functionT...
Date Fri, 31 Mar 2006 00:48:32 GMT
Author: rhillegas
Date: Thu Mar 30 16:48:31 2006
New Revision: 390292

URL: http://svn.apache.org/viewcvs?rev=390292&view=rev
Log:
Commit Kristian's first patch for DERBY-1147, adding vacuous implementations of missing CallableStatement
methods.

Added:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
  (with props)
Removed:
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/TestCallableStatementMethods.java
Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement40.java?rev=390292&r1=390291&r2=390292&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement40.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CallableStatement40.java Thu
Mar 30 16:48:31 2006
@@ -2,7 +2,7 @@
  
    Derby - Class org.apache.derby.client.am.CallableStatement40
  
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+   Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
 
 import java.io.InputStream;
 import java.io.Reader;
+import java.sql.Blob;
+import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.RowId;
 import java.sql.SQLException;
@@ -37,7 +39,37 @@
         super(agent, connection, sql, type, concurrency, holdability);        
     }
     
+    public Reader getCharacterStream(int parameterIndex)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("getCharacterStream(int)");
+    }
     
+    public Reader getCharacterStream(String parameterName)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("getCharacterStream(String)");
+    }
+
+    public Reader getNCharacterStream(int parameterIndex)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("getNCharacterStream(int)");
+    }
+    
+    public Reader getNCharacterStream(String parameterName)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented(
+                "getNCharacterStream(String)");
+    }
+
+    public String getNString(int parameterIndex)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("getNString(int)");
+    }
+
+    public String getNString(String parameterIndex)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("getNString(String)");
+    }
+
     public RowId getRowId(int parameterIndex) throws SQLException {
         throw SQLExceptionFactory.notImplemented ("getRowId (int)");
     }
@@ -50,6 +82,15 @@
         throw SQLExceptionFactory.notImplemented ("setRowId (String, RowId)");
     }
     
+    public void setBlob(String parameterName, Blob x)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("setBlob(String, Blob)");
+    }
+    
+    public void setClob(String parameterName, Clob x)
+        throws SQLException {
+        throw SQLExceptionFactory.notImplemented("setClob(String, Clob)");
+    }
     
     public void setNString(String parameterName, String value)
     throws SQLException {

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/iapi/jdbc/BrokeredCallableStatement40.java?rev=390292&r1=390291&r2=390292&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 Mar 30 16:48:31 2006
@@ -2,7 +2,7 @@
  
    Derby - Class org.apache.derby.iapi.jdbc.BrokeredCallableStatement40
  
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+   Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.
  
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
 
 import java.io.Reader;
 import java.io.InputStream;
+import java.sql.Blob;
+import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.RowId;
 import java.sql.SQLException;
@@ -33,6 +35,36 @@
         super(control,jdbcLevel,sql);
     }
     
+    public Reader getCharacterStream(int parameterIndex)
+        throws SQLException {
+        return getCallableStatement().getCharacterStream(parameterIndex);
+    }
+    
+    public Reader getCharacterStream(String parameterName)
+        throws SQLException {
+        return getCallableStatement().getCharacterStream(parameterName);
+    }
+    
+    public Reader getNCharacterStream(int parameterIndex)
+        throws SQLException {
+        return getCallableStatement().getNCharacterStream(parameterIndex);
+    }
+    
+    public Reader getNCharacterStream(String parameterName)
+        throws SQLException {
+        return getCallableStatement().getNCharacterStream(parameterName);
+    }
+
+    public String getNString(int parameterIndex)
+        throws SQLException {
+        return getCallableStatement().getNString(parameterIndex);
+    }
+
+    public String getNString(String parameterName)
+        throws SQLException {
+        return getCallableStatement().getNString(parameterName);
+    }
+
     public RowId getRowId(int parameterIndex) throws SQLException{
         return getCallableStatement().getRowId(parameterIndex);
     }
@@ -45,7 +77,16 @@
         getCallableStatement().setRowId(parameterName,x);
     }
     
-    
+    public void setBlob(String parameterName, Blob x)
+        throws SQLException {
+        getCallableStatement().setBlob(parameterName, x);
+    }
+
+    public void setClob(String parameterName, Clob x)
+        throws SQLException {
+        getCallableStatement().setClob(parameterName, x);
+    }
+
     public void setNString(String parameterName, String value)
     throws SQLException{
         getCallableStatement().setNString(parameterName,value);

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java?rev=390292&r1=390291&r2=390292&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/jdbc/EmbedCallableStatement40.java
Thu Mar 30 16:48:31 2006
@@ -2,7 +2,7 @@
 
    Derby - Class org.apache.derby.impl.jdbc.EmbedCallableStatement40
 
-   Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+   Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.
 
    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
@@ -22,6 +22,8 @@
 
 import java.io.InputStream;
 import java.io.Reader;
+import java.sql.Blob;
+import java.sql.Clob;
 import java.sql.NClob;
 import java.sql.RowId;
 import java.sql.SQLException;
@@ -38,7 +40,46 @@
         super(conn, sql, resultSetType, resultSetConcurrency, resultSetHoldability);    

     }
     
+    public Reader getCharacterStream(int parameterIndex)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public Reader getCharacterStream(String parameterName)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public Reader getNCharacterStream(int parameterIndex)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+    
+    public Reader getNCharacterStream(String parameterName)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
     
+    public String getNString(int parameterIndex)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+    
+    public String getNString(String parameterName)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+
+    public void setBlob(String parameterName, Blob x)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+    
+    public void setClob(String parameterName, Clob x)
+        throws SQLException {
+        throw Util.notImplemented();
+    }
+
     public RowId getRowId(int parameterIndex) throws SQLException {
         throw Util.notImplemented();
     }

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall?rev=390292&r1=390291&r2=390292&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall
(original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbc40.runall
Thu Mar 30 16:48:31 2006
@@ -1,9 +1,9 @@
 jdbc4/TestConnectionMethods.java
-jdbc4/TestCallableStatementMethods.java
 jdbc4/TestPreparedStatementMethods.java
 jdbc4/TestResultSetMethods.java
 jdbc4/TestQueryObject.java
 jdbc4/TestDbMetaData.java
 jdbc4/TestJDBC40Exception.java
+jdbc4/CallableStatementTest.junit
 jdbc4/RowIdNotImplementedTest.junit
 jdbc4/StatementTest.junit

Added: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java?rev=390292&view=auto
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
(added)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
Thu Mar 30 16:48:31 2006
@@ -0,0 +1,275 @@
+/*
+ 
+   Derby - Class CallableStatementTest
+ 
+   Copyright 2006 The Apache Software Foundation or its licensors, as applicable.
+ 
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+ 
+      http://www.apache.org/licenses/LICENSE-2.0
+ 
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+ 
+ */
+
+package org.apache.derbyTesting.functionTests.tests.jdbc4;
+
+import junit.framework.*;
+
+import org.apache.derbyTesting.functionTests.util.BaseJDBCTestCase;
+
+import java.sql.*;
+
+/**
+ * Tests of the <code>java.sql.CallableStatement</code> JDBC40 API.
+ */
+public class CallableStatementTest
+    extends BaseJDBCTestCase {
+
+    /** Default connection used by the tests. */
+    private Connection con = null;
+    /** Default callable statement used by the tests. */
+    private CallableStatement cStmt = null;
+    
+
+    /**
+     * Create a test with the given name.
+     *
+     * @param name name of the test.
+     */
+    public CallableStatementTest(String name) {
+        super(name);
+    }
+
+    /**
+     * Create a default callable statement and connection.
+     *
+     * @throws SQLException if creation of connection or callable statement
+     *                      fail.
+     */
+    public void setUp() 
+        throws SQLException {
+        con = getConnection();
+        cStmt = con.prepareCall("values 1");
+    }
+
+    /**
+     * Close default callable statement and connection.
+     *
+     * @throws SQLException if closing of the connection or the callable
+     *                      statement fail.
+     */
+    public void tearDown()
+        throws SQLException {
+        if (cStmt != null && !cStmt.isClosed()) {
+            cStmt.close();
+        }
+        if (con != null && !con.isClosed()) {
+            con.rollback();
+            con.close();
+        }
+        cStmt = null;
+        con = null;
+    }
+   
+    public void testGetNClobIntNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getNClob(1);
+            fail("CallableStatement.getNClob(int) should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+    
+    public void testGetNClobStringNotImplemented() 
+        throws SQLException {
+        try {
+            cStmt.getNClob("some-parameter-name");
+            fail("CallableStatement.getNClob(String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testGetNStringIntNotImplemented() 
+        throws SQLException {
+        try {
+            cStmt.getNString(1);
+            fail("CallableStatement.getNString(int) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testGetNStringStringNotImplemented() 
+        throws SQLException {
+        try {
+            cStmt.getNString("some-parameter-name");
+            fail("CallableStatement.getNString(String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testGetCharacterStreamIntNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getCharacterStream(1);
+            fail("CallableStatement.getCharacterStream(int) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+    
+    public void testGetCharacterStreamStringNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getCharacterStream("some-parameter-name");
+            fail("CallableStatement.getCharacterStream(String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testGetNCharacterStreamIntNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getNCharacterStream(1);
+            fail("CallableStatement.getNCharacterStream(int) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+    
+    public void testGetNCharacterStreamStringNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getNCharacterStream("some-parameter-name");
+            fail("CallableStatement.getNCharacterStream(String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetBlobNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setBlob("some-parameter-name", null);
+            fail("CallableStatement.setBlob(String, Blob) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+    
+    public void testSetClobNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setClob("some-parameter-name", null);
+            fail("CallableStatement.setClob(String, Clob) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetNCharacterStreamNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setNCharacterStream("some-parameter-name", null, 0l);
+            fail("CallableStatement.setNCharacterStream(String,Reader,long) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetNClobNClobNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setNClob("some-parameter-name", null);
+            fail("CallableStatement.setNClob(String, NClob) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetNClobReaderNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setNClob("some-parameter-name", null, 0l);
+            fail("CallableStatement.setNClob(String, Reader, long) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetNStringNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setNString("some-parameter-name", "some-value");
+            fail("CallableStatement.setNString(String, String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+   
+    public void testGetSQLXMLIntNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getSQLXML(1);
+            fail("CallableStatement.getSQLXML(int) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+    
+    public void testGetSQLXMLStringNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.getSQLXML("some-parameter-name");
+            fail("CallableStatement.getSQLXML(String) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    public void testSetSQLXMLNotImplemented()
+        throws SQLException {
+        try {
+            cStmt.setSQLXML("some-parameter-name", null);
+            fail("CallableStatement.setSQLXML(String, SQLXML) " +
+                 "should not be implemented");
+        } catch (SQLFeatureNotSupportedException sfnse) {
+            // We are fine, do nothing.
+        }
+    }
+
+    /**
+     * Return suite with all tests of the class.
+     */
+    public static Test suite() {
+        return (new TestSuite(CallableStatementTest.class,
+                              "CallableStatementTest suite"));
+    }
+    
+} // End class CallableStatementTest

Propchange: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbc4/CallableStatementTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message