db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r171115 - in /incubator/derby/code/trunk/java: engine/org/apache/derby/iapi/types/ testing/org/apache/derbyTesting/functionTests/master/ testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/
Date Fri, 20 May 2005 13:29:03 GMT
Author: djd
Date: Fri May 20 06:29:01 2005
New Revision: 171115

URL: http://svn.apache.org/viewcvs?rev=171115&view=rev
Log:
Fix Derby-203 setNull(x,JDBCType.DATE) does not work when batching is turned on

Use explicit setXXX methods for binary, DATE and TIME types when setting
a DataValueDescriptor into a PreparedStatement. Replaced the use of setObject
for these types which lead to un-typed NULLs being set into a PreparedStatement.

Patch contributed by Shreyas Kaushik <Shreyas.Kaushik@Sun.COM>

Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/parameterMapping.out
    incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java?rev=171115&r1=171114&r2=171115&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLBinary.java Fri
May 20 06:29:01 2005
@@ -58,6 +58,7 @@
 
 import java.sql.ResultSet;
 import java.sql.SQLException;
+import java.sql.PreparedStatement;
 
 /**
  * SQLBinary satisfies the DataValueDescriptor
@@ -1080,4 +1081,12 @@
 		return 0;
 
 	}
+
+      /** Adding this method to ensure that super class' setInto method doesn't get called
+      * that leads to the violation of JDBC spec( untyped nulls ) when batching is turned
on.
+      */
+     public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException
{
+
+                  ps.setBytes(position, getBytes());
+     }
 }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java?rev=171115&r1=171114&r2=171115&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLDate.java Fri May
20 06:29:01 2005
@@ -51,6 +51,7 @@
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Types;
+import java.sql.PreparedStatement;
 
 import java.util.Calendar;
 import java.util.GregorianCalendar;
@@ -997,4 +998,13 @@
             throw se;
         }
     } // end of computeDateFunction
+
+    /** Adding this method to ensure that super class' setInto method doesn't get called
+      * that leads to the violation of JDBC spec( untyped nulls ) when batching is turned
on.
+      */     
+    public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException
{
+
+                  ps.setDate(position, getDate((Calendar) null));
+     }
+
 }

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java?rev=171115&r1=171114&r2=171115&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/types/SQLTime.java Fri May
20 06:29:01 2005
@@ -48,6 +48,7 @@
 import java.sql.Time;
 import java.sql.Timestamp;
 import java.sql.Types;
+import java.sql.PreparedStatement;
 
 import java.util.Calendar;
 import java.util.GregorianCalendar;
@@ -965,5 +966,14 @@
 		currentCal.setTime(value);
 		return computeEncodedTime(currentCal);
 	}
+
+     /** Adding this method to ensure that super class' setInto method doesn't get called
+      * that leads to the violation of JDBC spec( untyped nulls ) when batching is turned
on.
+      */
+    public void setInto(PreparedStatement ps, int position) throws SQLException, StandardException
{
+
+		      ps.setTime(position, getTime((Calendar) null));
+   }
+
 }
 

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/parameterMapping.out
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/parameterMapping.out?rev=171115&r1=171114&r2=171115&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/parameterMapping.out
(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/parameterMapping.out
Fri May 20 06:29:01 2005
@@ -48,26 +48,47 @@
   getObject=CORRECT :java.lang.Integer was null false
 setNull() with all JDBC Types on SMALLINT
   setNull(Types.TINYINT) getShort=0 was null true
+  setNull with batching support(Types.TINYINT) getShort=0 was null true
   setNull(SMALLINT) getShort=0 was null true
+  setNull with batching support(SMALLINT) getShort=0 was null true
   setNull(INTEGER) getShort=0 was null true
+  setNull with batching support(INTEGER) getShort=0 was null true
   setNull(BIGINT) getShort=0 was null true
+  setNull with batching support(BIGINT) getShort=0 was null true
   setNull(REAL) getShort=0 was null true
+  setNull with batching support(REAL) getShort=0 was null true
   setNull(Types.FLOAT) getShort=0 was null true
+  setNull with batching support(Types.FLOAT) getShort=0 was null true
   setNull(DOUBLE) getShort=0 was null true
+  setNull with batching support(DOUBLE) getShort=0 was null true
   setNull(DECIMAL) getShort=0 was null true
+  setNull with batching support(DECIMAL) getShort=0 was null true
   setNull(Types.NUMERIC) getShort=0 was null true
+  setNull with batching support(Types.NUMERIC) getShort=0 was null true
   setNull(Types.BIT) getShort=0 was null true
+  setNull with batching support(Types.BIT) getShort=0 was null true
   setNull(CHAR) getShort=0 was null true
+  setNull with batching support(CHAR) getShort=0 was null true
   setNull(VARCHAR) getShort=0 was null true
+  setNull with batching support(VARCHAR) getShort=0 was null true
   setNull(LONG VARCHAR) getShort=0 was null true
+  setNull with batching support(LONG VARCHAR) getShort=0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on SMALLINT
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getShort=98 was null false JDBC MATCH(OK)
@@ -223,26 +244,47 @@
   getObject=CORRECT :java.lang.Integer was null false
 setNull() with all JDBC Types on INTEGER
   setNull(Types.TINYINT) getInt=0 was null true
+  setNull with batching support(Types.TINYINT) getInt=0 was null true
   setNull(SMALLINT) getInt=0 was null true
+  setNull with batching support(SMALLINT) getInt=0 was null true
   setNull(INTEGER) getInt=0 was null true
+  setNull with batching support(INTEGER) getInt=0 was null true
   setNull(BIGINT) getInt=0 was null true
+  setNull with batching support(BIGINT) getInt=0 was null true
   setNull(REAL) getInt=0 was null true
+  setNull with batching support(REAL) getInt=0 was null true
   setNull(Types.FLOAT) getInt=0 was null true
+  setNull with batching support(Types.FLOAT) getInt=0 was null true
   setNull(DOUBLE) getInt=0 was null true
+  setNull with batching support(DOUBLE) getInt=0 was null true
   setNull(DECIMAL) getInt=0 was null true
+  setNull with batching support(DECIMAL) getInt=0 was null true
   setNull(Types.NUMERIC) getInt=0 was null true
+  setNull with batching support(Types.NUMERIC) getInt=0 was null true
   setNull(Types.BIT) getInt=0 was null true
+  setNull with batching support(Types.BIT) getInt=0 was null true
   setNull(CHAR) getInt=0 was null true
+  setNull with batching support(CHAR) getInt=0 was null true
   setNull(VARCHAR) getInt=0 was null true
+  setNull with batching support(VARCHAR) getInt=0 was null true
   setNull(LONG VARCHAR) getInt=0 was null true
+  setNull with batching support(LONG VARCHAR) getInt=0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on INTEGER
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getInt=98 was null false JDBC MATCH(OK)
@@ -398,26 +440,47 @@
   getObject=CORRECT :java.lang.Long was null false
 setNull() with all JDBC Types on BIGINT
   setNull(Types.TINYINT) getLong=0 was null true
+  setNull with batching support(Types.TINYINT) getLong=0 was null true
   setNull(SMALLINT) getLong=0 was null true
+  setNull with batching support(SMALLINT) getLong=0 was null true
   setNull(INTEGER) getLong=0 was null true
+  setNull with batching support(INTEGER) getLong=0 was null true
   setNull(BIGINT) getLong=0 was null true
+  setNull with batching support(BIGINT) getLong=0 was null true
   setNull(REAL) getLong=0 was null true
+  setNull with batching support(REAL) getLong=0 was null true
   setNull(Types.FLOAT) getLong=0 was null true
+  setNull with batching support(Types.FLOAT) getLong=0 was null true
   setNull(DOUBLE) getLong=0 was null true
+  setNull with batching support(DOUBLE) getLong=0 was null true
   setNull(DECIMAL) getLong=0 was null true
+  setNull with batching support(DECIMAL) getLong=0 was null true
   setNull(Types.NUMERIC) getLong=0 was null true
+  setNull with batching support(Types.NUMERIC) getLong=0 was null true
   setNull(Types.BIT) getLong=0 was null true
+  setNull with batching support(Types.BIT) getLong=0 was null true
   setNull(CHAR) getLong=0 was null true
+  setNull with batching support(CHAR) getLong=0 was null true
   setNull(VARCHAR) getLong=0 was null true
+  setNull with batching support(VARCHAR) getLong=0 was null true
   setNull(LONG VARCHAR) getLong=0 was null true
+  setNull with batching support(LONG VARCHAR) getLong=0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on BIGINT
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getLong=98 was null false JDBC MATCH(OK)
@@ -573,26 +636,47 @@
   getObject=CORRECT :java.lang.Float was null false
 setNull() with all JDBC Types on REAL
   setNull(Types.TINYINT) getFloat=0.0 was null true
+  setNull with batching support(Types.TINYINT) getFloat=0.0 was null true
   setNull(SMALLINT) getFloat=0.0 was null true
+  setNull with batching support(SMALLINT) getFloat=0.0 was null true
   setNull(INTEGER) getFloat=0.0 was null true
+  setNull with batching support(INTEGER) getFloat=0.0 was null true
   setNull(BIGINT) getFloat=0.0 was null true
+  setNull with batching support(BIGINT) getFloat=0.0 was null true
   setNull(REAL) getFloat=0.0 was null true
+  setNull with batching support(REAL) getFloat=0.0 was null true
   setNull(Types.FLOAT) getFloat=0.0 was null true
+  setNull with batching support(Types.FLOAT) getFloat=0.0 was null true
   setNull(DOUBLE) getFloat=0.0 was null true
+  setNull with batching support(DOUBLE) getFloat=0.0 was null true
   setNull(DECIMAL) getFloat=0.0 was null true
+  setNull with batching support(DECIMAL) getFloat=0.0 was null true
   setNull(Types.NUMERIC) getFloat=0.0 was null true
+  setNull with batching support(Types.NUMERIC) getFloat=0.0 was null true
   setNull(Types.BIT) getFloat=0.0 was null true
+  setNull with batching support(Types.BIT) getFloat=0.0 was null true
   setNull(CHAR) getFloat=0.0 was null true
+  setNull with batching support(CHAR) getFloat=0.0 was null true
   setNull(VARCHAR) getFloat=0.0 was null true
+  setNull with batching support(VARCHAR) getFloat=0.0 was null true
   setNull(LONG VARCHAR) getFloat=0.0 was null true
+  setNull with batching support(LONG VARCHAR) getFloat=0.0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on REAL
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getFloat=98.0 was null false JDBC MATCH(OK)
@@ -749,26 +833,47 @@
   getObject=CORRECT :java.lang.Double was null false
 setNull() with all JDBC Types on FLOAT
   setNull(Types.TINYINT) getDouble=0.0 was null true
+  setNull with batching support(Types.TINYINT) getDouble=0.0 was null true
   setNull(SMALLINT) getDouble=0.0 was null true
+  setNull with batching support(SMALLINT) getDouble=0.0 was null true
   setNull(INTEGER) getDouble=0.0 was null true
+  setNull with batching support(INTEGER) getDouble=0.0 was null true
   setNull(BIGINT) getDouble=0.0 was null true
+  setNull with batching support(BIGINT) getDouble=0.0 was null true
   setNull(REAL) getDouble=0.0 was null true
+  setNull with batching support(REAL) getDouble=0.0 was null true
   setNull(Types.FLOAT) getDouble=0.0 was null true
+  setNull with batching support(Types.FLOAT) getDouble=0.0 was null true
   setNull(DOUBLE) getDouble=0.0 was null true
+  setNull with batching support(DOUBLE) getDouble=0.0 was null true
   setNull(DECIMAL) getDouble=0.0 was null true
+  setNull with batching support(DECIMAL) getDouble=0.0 was null true
   setNull(Types.NUMERIC) getDouble=0.0 was null true
+  setNull with batching support(Types.NUMERIC) getDouble=0.0 was null true
   setNull(Types.BIT) getDouble=0.0 was null true
+  setNull with batching support(Types.BIT) getDouble=0.0 was null true
   setNull(CHAR) getDouble=0.0 was null true
+  setNull with batching support(CHAR) getDouble=0.0 was null true
   setNull(VARCHAR) getDouble=0.0 was null true
+  setNull with batching support(VARCHAR) getDouble=0.0 was null true
   setNull(LONG VARCHAR) getDouble=0.0 was null true
+  setNull with batching support(LONG VARCHAR) getDouble=0.0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on FLOAT
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getDouble=98.0 was null false JDBC MATCH(OK)
@@ -924,26 +1029,47 @@
   getObject=CORRECT :java.lang.Double was null false
 setNull() with all JDBC Types on DOUBLE
   setNull(Types.TINYINT) getDouble=0.0 was null true
+  setNull with batching support(Types.TINYINT) getDouble=0.0 was null true
   setNull(SMALLINT) getDouble=0.0 was null true
+  setNull with batching support(SMALLINT) getDouble=0.0 was null true
   setNull(INTEGER) getDouble=0.0 was null true
+  setNull with batching support(INTEGER) getDouble=0.0 was null true
   setNull(BIGINT) getDouble=0.0 was null true
+  setNull with batching support(BIGINT) getDouble=0.0 was null true
   setNull(REAL) getDouble=0.0 was null true
+  setNull with batching support(REAL) getDouble=0.0 was null true
   setNull(Types.FLOAT) getDouble=0.0 was null true
+  setNull with batching support(Types.FLOAT) getDouble=0.0 was null true
   setNull(DOUBLE) getDouble=0.0 was null true
+  setNull with batching support(DOUBLE) getDouble=0.0 was null true
   setNull(DECIMAL) getDouble=0.0 was null true
+  setNull with batching support(DECIMAL) getDouble=0.0 was null true
   setNull(Types.NUMERIC) getDouble=0.0 was null true
+  setNull with batching support(Types.NUMERIC) getDouble=0.0 was null true
   setNull(Types.BIT) getDouble=0.0 was null true
+  setNull with batching support(Types.BIT) getDouble=0.0 was null true
   setNull(CHAR) getDouble=0.0 was null true
+  setNull with batching support(CHAR) getDouble=0.0 was null true
   setNull(VARCHAR) getDouble=0.0 was null true
+  setNull with batching support(VARCHAR) getDouble=0.0 was null true
   setNull(LONG VARCHAR) getDouble=0.0 was null true
+  setNull with batching support(LONG VARCHAR) getDouble=0.0 was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on DOUBLE
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getDouble=98.0 was null false JDBC MATCH(OK)
@@ -1099,26 +1225,47 @@
   getObject=CORRECT :java.math.BigDecimal was null false
 setNull() with all JDBC Types on DECIMAL(10,5)
   setNull(Types.TINYINT) getBigDecimal=null was null true
+  setNull with batching support(Types.TINYINT) getBigDecimal=null was null true
   setNull(SMALLINT) getBigDecimal=null was null true
+  setNull with batching support(SMALLINT) getBigDecimal=null was null true
   setNull(INTEGER) getBigDecimal=null was null true
+  setNull with batching support(INTEGER) getBigDecimal=null was null true
   setNull(BIGINT) getBigDecimal=null was null true
+  setNull with batching support(BIGINT) getBigDecimal=null was null true
   setNull(REAL) getBigDecimal=null was null true
+  setNull with batching support(REAL) getBigDecimal=null was null true
   setNull(Types.FLOAT) getBigDecimal=null was null true
+  setNull with batching support(Types.FLOAT) getBigDecimal=null was null true
   setNull(DOUBLE) getBigDecimal=null was null true
+  setNull with batching support(DOUBLE) getBigDecimal=null was null true
   setNull(DECIMAL) getBigDecimal=null was null true
+  setNull with batching support(DECIMAL) getBigDecimal=null was null true
   setNull(Types.NUMERIC) getBigDecimal=null was null true
+  setNull with batching support(Types.NUMERIC) getBigDecimal=null was null true
   setNull(Types.BIT) getBigDecimal=null was null true
+  setNull with batching support(Types.BIT) getBigDecimal=null was null true
   setNull(CHAR) getBigDecimal=null was null true
+  setNull with batching support(CHAR) getBigDecimal=null was null true
   setNull(VARCHAR) getBigDecimal=null was null true
+  setNull with batching support(VARCHAR) getBigDecimal=null was null true
   setNull(LONG VARCHAR) getBigDecimal=null was null true
+  setNull with batching support(LONG VARCHAR) getBigDecimal=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on DECIMAL(10,5)
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getBigDecimal=98.00000 was null false JDBC MATCH(OK)
@@ -1280,26 +1427,47 @@
   getObject=CORRECT :java.lang.String was null false
 setNull() with all JDBC Types on CHAR(60)
   setNull(Types.TINYINT) getString=null was null true
+  setNull with batching support(Types.TINYINT) getString=null was null true
   setNull(SMALLINT) getString=null was null true
+  setNull with batching support(SMALLINT) getString=null was null true
   setNull(INTEGER) getString=null was null true
+  setNull with batching support(INTEGER) getString=null was null true
   setNull(BIGINT) getString=null was null true
+  setNull with batching support(BIGINT) getString=null was null true
   setNull(REAL) getString=null was null true
+  setNull with batching support(REAL) getString=null was null true
   setNull(Types.FLOAT) getString=null was null true
+  setNull with batching support(Types.FLOAT) getString=null was null true
   setNull(DOUBLE) getString=null was null true
+  setNull with batching support(DOUBLE) getString=null was null true
   setNull(DECIMAL) getString=null was null true
+  setNull with batching support(DECIMAL) getString=null was null true
   setNull(Types.NUMERIC) getString=null was null true
+  setNull with batching support(Types.NUMERIC) getString=null was null true
   setNull(Types.BIT) getString=null was null true
+  setNull with batching support(Types.BIT) getString=null was null true
   setNull(CHAR) getString=null was null true
+  setNull with batching support(CHAR) getString=null was null true
   setNull(VARCHAR) getString=null was null true
+  setNull with batching support(VARCHAR) getString=null was null true
   setNull(LONG VARCHAR) getString=null was null true
+  setNull with batching support(LONG VARCHAR) getString=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) getString=null was null true
+  setNull with batching support(DATE) getString=null was null true
   setNull(TIME) getString=null was null true
+  setNull with batching support(TIME) getString=null was null true
   setNull(TIMESTAMP) getString=null was null true
+  setNull with batching support(TIMESTAMP) getString=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on CHAR(60)
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getString=98                                                           was null
false JDBC MATCH(OK)
@@ -1450,26 +1618,47 @@
   getObject=CORRECT :java.lang.String was null false
 setNull() with all JDBC Types on VARCHAR(60)
   setNull(Types.TINYINT) getString=null was null true
+  setNull with batching support(Types.TINYINT) getString=null was null true
   setNull(SMALLINT) getString=null was null true
+  setNull with batching support(SMALLINT) getString=null was null true
   setNull(INTEGER) getString=null was null true
+  setNull with batching support(INTEGER) getString=null was null true
   setNull(BIGINT) getString=null was null true
+  setNull with batching support(BIGINT) getString=null was null true
   setNull(REAL) getString=null was null true
+  setNull with batching support(REAL) getString=null was null true
   setNull(Types.FLOAT) getString=null was null true
+  setNull with batching support(Types.FLOAT) getString=null was null true
   setNull(DOUBLE) getString=null was null true
+  setNull with batching support(DOUBLE) getString=null was null true
   setNull(DECIMAL) getString=null was null true
+  setNull with batching support(DECIMAL) getString=null was null true
   setNull(Types.NUMERIC) getString=null was null true
+  setNull with batching support(Types.NUMERIC) getString=null was null true
   setNull(Types.BIT) getString=null was null true
+  setNull with batching support(Types.BIT) getString=null was null true
   setNull(CHAR) getString=null was null true
+  setNull with batching support(CHAR) getString=null was null true
   setNull(VARCHAR) getString=null was null true
+  setNull with batching support(VARCHAR) getString=null was null true
   setNull(LONG VARCHAR) getString=null was null true
+  setNull with batching support(LONG VARCHAR) getString=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) getString=null was null true
+  setNull with batching support(DATE) getString=null was null true
   setNull(TIME) getString=null was null true
+  setNull with batching support(TIME) getString=null was null true
   setNull(TIMESTAMP) getString=null was null true
+  setNull with batching support(TIMESTAMP) getString=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on VARCHAR(60)
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getString=98 was null false JDBC MATCH(OK)
@@ -1620,26 +1809,47 @@
   getObject=CORRECT :java.lang.String was null false
 setNull() with all JDBC Types on LONG VARCHAR
   setNull(Types.TINYINT) getString=null was null true
+  setNull with batching support(Types.TINYINT) getString=null was null true
   setNull(SMALLINT) getString=null was null true
+  setNull with batching support(SMALLINT) getString=null was null true
   setNull(INTEGER) getString=null was null true
+  setNull with batching support(INTEGER) getString=null was null true
   setNull(BIGINT) getString=null was null true
+  setNull with batching support(BIGINT) getString=null was null true
   setNull(REAL) getString=null was null true
+  setNull with batching support(REAL) getString=null was null true
   setNull(Types.FLOAT) getString=null was null true
+  setNull with batching support(Types.FLOAT) getString=null was null true
   setNull(DOUBLE) getString=null was null true
+  setNull with batching support(DOUBLE) getString=null was null true
   setNull(DECIMAL) getString=null was null true
+  setNull with batching support(DECIMAL) getString=null was null true
   setNull(Types.NUMERIC) getString=null was null true
+  setNull with batching support(Types.NUMERIC) getString=null was null true
   setNull(Types.BIT) getString=null was null true
+  setNull with batching support(Types.BIT) getString=null was null true
   setNull(CHAR) getString=null was null true
+  setNull with batching support(CHAR) getString=null was null true
   setNull(VARCHAR) getString=null was null true
+  setNull with batching support(VARCHAR) getString=null was null true
   setNull(LONG VARCHAR) getString=null was null true
+  setNull with batching support(LONG VARCHAR) getString=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) getString=null was null true
+  setNull with batching support(DATE) getString=null was null true
   setNull(TIME) getString=null was null true
+  setNull with batching support(TIME) getString=null was null true
   setNull(TIMESTAMP) getString=null was null true
+  setNull with batching support(TIMESTAMP) getString=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on LONG VARCHAR
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() getString=98 was null false JDBC MATCH(OK)
@@ -1736,26 +1946,47 @@
   getObject=CORRECT :[B was null false
 setNull() with all JDBC Types on VARCHAR(60) FOR BIT DATA
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) IC
+  setNull with batching support(CHAR) IC
   setNull(VARCHAR) IC
+  setNull with batching support(VARCHAR) IC
   setNull(LONG VARCHAR) IC
+  setNull with batching support(LONG VARCHAR) IC
   setNull(VARCHAR () FOR BIT DATA) getBytes=null was null true
+  setNull with batching support(VARCHAR () FOR BIT DATA) getBytes=null was null true
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on VARCHAR(60) FOR BIT DATA
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)
@@ -1891,26 +2122,47 @@
   getObject=CORRECT :java.sql.Date was null false
 setNull() with all JDBC Types on DATE
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) getDate=null was null true
+  setNull with batching support(CHAR) getDate=null was null true
   setNull(VARCHAR) getDate=null was null true
+  setNull with batching support(VARCHAR) getDate=null was null true
   setNull(LONG VARCHAR) getDate=null was null true
+  setNull with batching support(LONG VARCHAR) getDate=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) getDate=null was null true
+  setNull with batching support(DATE) getDate=null was null true
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) getDate=null was null true
+  setNull with batching support(TIMESTAMP) getDate=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on DATE
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)
@@ -2048,26 +2300,47 @@
   getObject=CORRECT :java.sql.Time was null false
 setNull() with all JDBC Types on TIME
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) getTime=null was null true
+  setNull with batching support(CHAR) getTime=null was null true
   setNull(VARCHAR) getTime=null was null true
+  setNull with batching support(VARCHAR) getTime=null was null true
   setNull(LONG VARCHAR) getTime=null was null true
+  setNull with batching support(LONG VARCHAR) getTime=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) getTime=null was null true
+  setNull with batching support(TIME) getTime=null was null true
   setNull(TIMESTAMP) getTime=null was null true
+  setNull with batching support(TIMESTAMP) getTime=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on TIME
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)
@@ -2206,26 +2479,47 @@
   getObject=CORRECT :java.sql.Timestamp was null false
 setNull() with all JDBC Types on TIMESTAMP
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) getTimestamp=null was null true
+  setNull with batching support(CHAR) getTimestamp=null was null true
   setNull(VARCHAR) getTimestamp=null was null true
+  setNull with batching support(VARCHAR) getTimestamp=null was null true
   setNull(LONG VARCHAR) getTimestamp=null was null true
+  setNull with batching support(LONG VARCHAR) getTimestamp=null was null true
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) getTimestamp=null was null true
+  setNull with batching support(DATE) getTimestamp=null was null true
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) getTimestamp=null was null true
+  setNull with batching support(TIMESTAMP) getTimestamp=null was null true
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on TIMESTAMP
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)
@@ -2364,26 +2658,47 @@
   getObject=CORRECT :java.sql.Clob was null false
 setNull() with all JDBC Types on CLOB(1k)
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) IC
+  setNull with batching support(CHAR) IC
   setNull(VARCHAR) IC
+  setNull with batching support(VARCHAR) IC
   setNull(LONG VARCHAR) IC
+  setNull with batching support(LONG VARCHAR) IC
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) getClob=null was null true
+  setNull with batching support(CLOB) getClob=null was null true
   setNull(BLOB) IC
+  setNull with batching support(BLOB) IC
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on CLOB(1k)
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)
@@ -2478,26 +2793,47 @@
   getObject=CORRECT :java.sql.Blob was null false
 setNull() with all JDBC Types on BLOB(1k)
   setNull(Types.TINYINT) IC
+  setNull with batching support(Types.TINYINT) IC
   setNull(SMALLINT) IC
+  setNull with batching support(SMALLINT) IC
   setNull(INTEGER) IC
+  setNull with batching support(INTEGER) IC
   setNull(BIGINT) IC
+  setNull with batching support(BIGINT) IC
   setNull(REAL) IC
+  setNull with batching support(REAL) IC
   setNull(Types.FLOAT) IC
+  setNull with batching support(Types.FLOAT) IC
   setNull(DOUBLE) IC
+  setNull with batching support(DOUBLE) IC
   setNull(DECIMAL) IC
+  setNull with batching support(DECIMAL) IC
   setNull(Types.NUMERIC) IC
+  setNull with batching support(Types.NUMERIC) IC
   setNull(Types.BIT) IC
+  setNull with batching support(Types.BIT) IC
   setNull(CHAR) IC
+  setNull with batching support(CHAR) IC
   setNull(VARCHAR) IC
+  setNull with batching support(VARCHAR) IC
   setNull(LONG VARCHAR) IC
+  setNull with batching support(LONG VARCHAR) IC
   setNull(VARCHAR () FOR BIT DATA) IC
+  setNull with batching support(VARCHAR () FOR BIT DATA) IC
   setNull(DATE) IC
+  setNull with batching support(DATE) IC
   setNull(TIME) IC
+  setNull with batching support(TIME) IC
   setNull(TIMESTAMP) IC
+  setNull with batching support(TIMESTAMP) IC
   setNull(CLOB) IC
+  setNull with batching support(CLOB) IC
   setNull(BLOB) getBlob=null was null true
+  setNull with batching support(BLOB) getBlob=null was null true
   setNull(Types.NULL) IC
+  setNull with batching support(Types.NULL) IC
   setNull(235350345) IC
+  setNull with batching support(235350345) IC
 setXXX() with all JDBC Types on BLOB(1k)
 For setXXX() methods that pass an object, a null and valid values are checked
   setByte() IC JDBC MATCH (INVALID)

Modified: incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java?rev=171115&r1=171114&r2=171115&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java
(original)
+++ incubator/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/parameterMapping.java
Fri May 20 06:29:01 2005
@@ -323,7 +323,7 @@
 				 if (rsmd.getColumnType(1) != jdbcTypes[type]) {
 					 System.out.println("FAIL - mismatch column type " + rsmd.getColumnType(1) + " expected
" + jdbcTypes[type]);
 				 }
-				 rs.close();
+				 rs.close();                                 				 			 
 
 				 // For this data type
 				 // Test inserting a NULL value and then performing all the getXXX() calls on it.
@@ -379,12 +379,37 @@
 								dumpSQLExceptions(sqle);
 
 						}
+						
+						/**
+						  * Adding this piece of code to test the support for batching of statements.
+						  * Some datatypes had problems when batching was turned on which was 
+						  * not there when batching was not on, this will test that behaviour
+						  * for all such datatypes
+						  */
+						s.execute("DELETE FROM PM.TYPE_AS");
+						try {
+							System.out.print("  setNull with batching support(" + TestUtil.sqlNameFromJdbc(sqlTypeNull)
+ ") ");
+							psi.setNull(1, sqlTypeNull);
+							psi.addBatch();
+							psi.executeBatch();
+
+							getValidValue(psq, jdbcTypes[type]); // yes type, not st
+
+							System.out.println("");
+
+						} catch (SQLException sqle) {							 
+							sqleResult = sqle;
+							if ("22005".equals(sqle.getSQLState()))
+								System.out.println("IC");
+							else
+								dumpSQLExceptions(sqle);													     
+						}						
 					}					 
 				 }
 
 				 System.out.println("setXXX() with all JDBC Types on " + SQLTypes[type]);
 				 System.out.println("For setXXX() methods that pass an object, a null and valid values
are checked");
-				 setXXX(s, psi, psq, type);
+				 setXXX(s, psi, psq, type);				 
 
 				 psi.close();
 				 psq.close();



Mime
View raw message