db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r358163 [1/4] - in /db/derby/code/trunk/java: client/org/apache/derby/client/am/ client/org/apache/derby/client/net/ drda/org/apache/derby/impl/drda/ engine/org/apache/derby/iapi/reference/ engine/org/apache/derby/impl/sql/compile/ testing/...
Date Wed, 21 Dec 2005 00:54:02 GMT
Author: djd
Date: Tue Dec 20 16:53:42 2005
New Revision: 358163

URL: http://svn.apache.org/viewcvs?rev=358163&view=rev
Log:
DERBY-499 Add BOOLEAN datatype. See jira comments for details.
Commit of patch bug499_rev4.diff, contributed by Rick Hillegas

Added:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/reference/DRDAConstants.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/lang/
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/lang/BooleanTest.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/lang/LangSuite.java   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/lang/build.xml   (with props)
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/lang/default_app.properties   (with props)
Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/ColumnMetaData.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/FdocaConstants.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConfiguration.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
    db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/SQLTypes.java
    db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/sqlgrammar.jj
    db/derby/code/trunk/java/testing/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/metadata.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/syscat.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/aggregate.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/db2Compatibility.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/implicitConversions.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/logop.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/schemas.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/subquery.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/valuesclause.out
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/derbylang.runall
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/CompatibilitySuite.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/JDBCDriverTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/junitTests/compatibility/testScript.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/aggregate.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/db2Compatibility.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/logop.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/schemas.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/subquery.sql
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/util/DerbyJUnitTest.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/ColumnMetaData.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/ColumnMetaData.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/ColumnMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/ColumnMetaData.java Tue Dec 20 16:53:42 2005
@@ -20,6 +20,9 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
 // Under JDBC 2, we must new up our parameter meta data as column meta data instances
 // Once we move to JDK 1.4 pre-req, create a ResultSetMetaData class and make this class abstract
 
@@ -219,6 +222,8 @@
         checkForValidColumnIndex(column);
         int jdbcType = types_[column - 1];
         switch (jdbcType) {
+        case Types.BOOLEAN:
+            return 5;
         case Types.INTEGER:
             return 11;
         case Types.SMALLINT:
@@ -402,67 +407,70 @@
         int sqlType = sqlType_[column - 1];
 
         switch (sqlType) {
-        case Types.DERBY_SQLTYPE_DATE:
-        case Types.DERBY_SQLTYPE_NDATE:
+        case DRDAConstants.DB2_SQLTYPE_BOOLEAN:
+        case DRDAConstants.DB2_SQLTYPE_NBOOLEAN:
+            return "BOOLEAN";
+        case DRDAConstants.DB2_SQLTYPE_DATE:
+        case DRDAConstants.DB2_SQLTYPE_NDATE:
             return "DATE";
-        case Types.DERBY_SQLTYPE_TIME:
-        case Types.DERBY_SQLTYPE_NTIME:
+        case DRDAConstants.DB2_SQLTYPE_TIME:
+        case DRDAConstants.DB2_SQLTYPE_NTIME:
             return "TIME";
-        case Types.DERBY_SQLTYPE_TIMESTAMP:
-        case Types.DERBY_SQLTYPE_NTIMESTAMP:
+        case DRDAConstants.DB2_SQLTYPE_TIMESTAMP:
+        case DRDAConstants.DB2_SQLTYPE_NTIMESTAMP:
             return "TIMESTAMP";
-        case Types.DERBY_SQLTYPE_BLOB:
-        case Types.DERBY_SQLTYPE_NBLOB:
+        case DRDAConstants.DB2_SQLTYPE_BLOB:
+        case DRDAConstants.DB2_SQLTYPE_NBLOB:
             return "BLOB";
-        case Types.DERBY_SQLTYPE_CLOB:
-        case Types.DERBY_SQLTYPE_NCLOB:
+        case DRDAConstants.DB2_SQLTYPE_CLOB:
+        case DRDAConstants.DB2_SQLTYPE_NCLOB:
             return "CLOB";
-        case Types.DERBY_SQLTYPE_VARCHAR:
-        case Types.DERBY_SQLTYPE_NVARCHAR:
+        case DRDAConstants.DB2_SQLTYPE_VARCHAR:
+        case DRDAConstants.DB2_SQLTYPE_NVARCHAR:
             if (jdbcType == Types.VARBINARY) {
                 return "VARCHAR FOR BIT DATA";
             } else {
                 return "VARCHAR";
             }
-        case Types.DERBY_SQLTYPE_CHAR:
-        case Types.DERBY_SQLTYPE_NCHAR:
+        case DRDAConstants.DB2_SQLTYPE_CHAR:
+        case DRDAConstants.DB2_SQLTYPE_NCHAR:
             if (jdbcType == Types.BINARY) {
                 return "CHAR FOR BIT DATA";
             } else {
                 return "CHAR";
             }
-        case Types.DERBY_SQLTYPE_LONG:
-        case Types.DERBY_SQLTYPE_NLONG:
+        case DRDAConstants.DB2_SQLTYPE_LONG:
+        case DRDAConstants.DB2_SQLTYPE_NLONG:
             if (jdbcType == Types.LONGVARBINARY) {
                 return "LONG VARCHAR FOR BIT DATA";
             } else {
                 return "LONG VARCHAR";
             }
-        case Types.DERBY_SQLTYPE_CSTR:
-        case Types.DERBY_SQLTYPE_NCSTR:
+        case DRDAConstants.DB2_SQLTYPE_CSTR:
+        case DRDAConstants.DB2_SQLTYPE_NCSTR:
             return "SBCS";
-        case Types.DERBY_SQLTYPE_FLOAT:
-        case Types.DERBY_SQLTYPE_NFLOAT:
+        case DRDAConstants.DB2_SQLTYPE_FLOAT:
+        case DRDAConstants.DB2_SQLTYPE_NFLOAT:
             if (jdbcType == Types.DOUBLE) {
                 return "DOUBLE";
             }
             if (jdbcType == Types.REAL) {
                 return "REAL";
             }
-        case Types.DERBY_SQLTYPE_DECIMAL:
-        case Types.DERBY_SQLTYPE_NDECIMAL:
+        case DRDAConstants.DB2_SQLTYPE_DECIMAL:
+        case DRDAConstants.DB2_SQLTYPE_NDECIMAL:
             return "DECIMAL";
-        case Types.DERBY_SQLTYPE_BIGINT:
-        case Types.DERBY_SQLTYPE_NBIGINT:
+        case DRDAConstants.DB2_SQLTYPE_BIGINT:
+        case DRDAConstants.DB2_SQLTYPE_NBIGINT:
             return "BIGINT";
-        case Types.DERBY_SQLTYPE_INTEGER:
-        case Types.DERBY_SQLTYPE_NINTEGER:
+        case DRDAConstants.DB2_SQLTYPE_INTEGER:
+        case DRDAConstants.DB2_SQLTYPE_NINTEGER:
             return "INTEGER";
-        case Types.DERBY_SQLTYPE_SMALL:
-        case Types.DERBY_SQLTYPE_NSMALL:
+        case DRDAConstants.DB2_SQLTYPE_SMALL:
+        case DRDAConstants.DB2_SQLTYPE_NSMALL:
             return "SMALLINT";
-        case Types.DERBY_SQLTYPE_NUMERIC:
-        case Types.DERBY_SQLTYPE_NNUMERIC:
+        case DRDAConstants.DB2_SQLTYPE_NUMERIC:
+        case DRDAConstants.DB2_SQLTYPE_NNUMERIC:
             return "NUMERIC";
         default:
             throw new SqlException(logWriter_, "Not supported");
@@ -780,52 +788,55 @@
     int mapDriverToSqlType(int type, boolean nullable) {
         int sqlType = 0;
         switch (type) {
+        case JDBC30Translation.BOOLEAN:
+            sqlType = DRDAConstants.DB2_SQLTYPE_NBOOLEAN;
+            break;
         case java.sql.Types.SMALLINT:
-            sqlType = Types.DERBY_SQLTYPE_NSMALL;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NSMALL;
             break;
         case java.sql.Types.INTEGER:
-            sqlType = Types.DERBY_SQLTYPE_NINTEGER;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NINTEGER;
             break;
         case java.sql.Types.BIGINT:
-            sqlType = Types.DERBY_SQLTYPE_NBIGINT;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NBIGINT;
             break;
         case java.sql.Types.REAL:
         case java.sql.Types.DOUBLE:
         case java.sql.Types.FLOAT:
-            sqlType = Types.DERBY_SQLTYPE_NFLOAT;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NFLOAT;
             break;
         case java.sql.Types.DATE:
-            sqlType = Types.DERBY_SQLTYPE_NDATE;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NDATE;
             break;
         case java.sql.Types.TIME:
-            sqlType = Types.DERBY_SQLTYPE_NTIME;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NTIME;
             break;
         case java.sql.Types.TIMESTAMP:
-            sqlType = Types.DERBY_SQLTYPE_NTIMESTAMP;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NTIMESTAMP;
             break;
         case java.sql.Types.CHAR:
         case java.sql.Types.VARCHAR:
-            sqlType = Types.DERBY_SQLTYPE_NVARCHAR;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NVARCHAR;
             break;
         case java.sql.Types.LONGVARCHAR:
-            sqlType = Types.DERBY_SQLTYPE_NLONG;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NLONG;
             break;
         case java.sql.Types.BINARY:
         case java.sql.Types.VARBINARY:
-            sqlType = Types.DERBY_SQLTYPE_NVARCHAR;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NVARCHAR;
             break;
         case java.sql.Types.LONGVARBINARY:
-            sqlType = Types.DERBY_SQLTYPE_NLONG;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NLONG;
             break;
         case java.sql.Types.NUMERIC:
         case java.sql.Types.DECIMAL:
-            sqlType = Types.DERBY_SQLTYPE_NDECIMAL;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NDECIMAL;
             break;
         case java.sql.Types.BLOB:
-            sqlType = Types.DERBY_SQLTYPE_NBLOB;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NBLOB;
             break;
         case java.sql.Types.CLOB:
-            sqlType = Types.DERBY_SQLTYPE_NCLOB;
+            sqlType = DRDAConstants.DB2_SQLTYPE_NCLOB;
             break;
         default:
             break; // bug check
@@ -873,8 +884,8 @@
     public boolean hasLobColumns() {
         for (int i = 0; i < columns_; i++) {
             switch (org.apache.derby.client.am.Utils.getNonNullableSqlType(sqlType_[i])) {
-            case org.apache.derby.client.am.Types.DERBY_SQLTYPE_BLOB:
-            case org.apache.derby.client.am.Types.DERBY_SQLTYPE_CLOB:
+            case DRDAConstants.DB2_SQLTYPE_BLOB:
+            case DRDAConstants.DB2_SQLTYPE_CLOB:
                 return true;
             default:
                 break;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/CrossConverters.java Tue Dec 20 16:53:42 2005
@@ -1148,7 +1148,7 @@
     //---------------------------- getString*() methods --------------------------
 
     final String getStringFromBoolean(boolean source) throws SqlException {
-        return source ? "1" : "0";
+        return source ? "true" : "false";
     }
 
     final String getStringFromBytes(byte[] bytes) throws SqlException {

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java Tue Dec 20 16:53:42 2005
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.am;
 
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
 // When we calculate column offsets make sure we calculate the correct offsets for double byte charactr5er data
 // length from server is number of chars, not bytes
 // Direct byte-level converters are called directly by this class, cross converters are deferred to the CrossConverters class.
@@ -264,6 +266,12 @@
     //------- the following getters are called on known column types -------------
     // Direct conversions only, cross conversions are handled by another set of getters.
 
+    // Build a Java boolean from a 1-byte signed binary representation.
+    private final boolean get_BOOLEAN(int column) {
+        return org.apache.derby.client.am.SignedBinary.getBoolean(dataBuffer_,
+                columnDataPosition_[column - 1]);
+    }
+
     // Build a Java short from a 2-byte signed binary representation.
     private final short get_SMALLINT(int column) {
         return org.apache.derby.client.am.SignedBinary.getShort(dataBuffer_,
@@ -505,6 +513,8 @@
 
     final boolean getBoolean(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return get_BOOLEAN(column);
         case java.sql.Types.SMALLINT:
             return agent_.crossConverters_.getBooleanFromShort(get_SMALLINT(column));
         case java.sql.Types.INTEGER:
@@ -531,6 +541,8 @@
     final byte getByte(int column) throws SqlException {
         // This needs to be changed to use jdbcTypes[]
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getByteFromBoolean( getBoolean(column) );
         case java.sql.Types.SMALLINT:
             return agent_.crossConverters_.getByteFromShort(get_SMALLINT(column));
         case java.sql.Types.INTEGER:
@@ -556,6 +568,8 @@
 
     final short getShort(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getShortFromBoolean( getBoolean(column) );
         case java.sql.Types.SMALLINT:
             return get_SMALLINT(column);
         case java.sql.Types.INTEGER:
@@ -581,6 +595,8 @@
 
     final int getInt(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getIntFromBoolean( getBoolean(column) );
         case java.sql.Types.SMALLINT:
             return (int) get_SMALLINT(column);
         case java.sql.Types.INTEGER:
@@ -606,6 +622,8 @@
 
     final long getLong(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getLongFromBoolean( getBoolean(column) );
         case java.sql.Types.SMALLINT:
             return (long) get_SMALLINT(column);
         case java.sql.Types.INTEGER:
@@ -631,6 +649,8 @@
 
     final float getFloat(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getFloatFromBoolean( getBoolean(column) );
         case java.sql.Types.REAL:
             return get_FLOAT(column);
         case java.sql.Types.DOUBLE:
@@ -656,6 +676,8 @@
 
     final double getDouble(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getDoubleFromBoolean( getBoolean(column) );
         case java.sql.Types.REAL:
             double d = (double) get_FLOAT(column);
             return d;
@@ -683,6 +705,8 @@
 
     final java.math.BigDecimal getBigDecimal(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getBigDecimalFromBoolean( getBoolean(column) );
         case java.sql.Types.DECIMAL:
             return get_DECIMAL(column);
         case java.sql.Types.REAL:
@@ -762,6 +786,8 @@
     final String getString(int column) throws SqlException {
         String tempString = null;
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return agent_.crossConverters_.getStringFromBoolean( getBoolean(column) );
         case java.sql.Types.CHAR:
             return getCHAR(column);
         case java.sql.Types.VARCHAR:
@@ -974,6 +1000,8 @@
 
     public final Object getObject(int column) throws SqlException {
         switch (jdbcTypes_[column - 1]) {
+        case JDBC30Translation.BOOLEAN:
+            return new Boolean( getBoolean(column) );
         case java.sql.Types.SMALLINT:
             return new Integer(get_SMALLINT(column)); // See Table 4 in JDBC 1 spec (pg. 932 in jdbc book)
         case java.sql.Types.INTEGER:

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/DatabaseMetaData.java Tue Dec 20 16:53:42 2005
@@ -1948,14 +1948,16 @@
 
 
     private boolean getMetaDataInfoBoolean(int infoCallIndex) throws SqlException {
-        if (metaDataInfoIsCached_) {
-            return ((Integer) metaDataInfoCache_[infoCallIndex]).intValue() != 0;
-        }
-        metaDataInfoCall();
-        return ((Integer) metaDataInfoCache_[infoCallIndex]).intValue() != 0;
+        if ( !metaDataInfoIsCached_) { metaDataInfoCall(); }
+
+        // account for fact that after 10.2 booleans are really booleans, not ints.
+        Object	metadataScrap = metaDataInfoCache_[infoCallIndex];
+
+        if ( metadataScrap instanceof Boolean ) { return ((Boolean) metadataScrap).booleanValue(); }
+        else { return ((Integer) metadataScrap).intValue() != 0; }
     }
 
-    private int getMetaDataInfoInt(int infoCallIndex) throws SqlException {
+	private int getMetaDataInfoInt(int infoCallIndex) throws SqlException {
         if (metaDataInfoIsCached_) {
             return ((Integer) metaDataInfoCache_[infoCallIndex]).intValue();
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/SignedBinary.java Tue Dec 20 16:53:42 2005
@@ -34,6 +34,15 @@
      */
     public final static int LITTLE_ENDIAN = 2;
 
+     /**
+     * Build a Java boolean from a byte.
+     *
+     */
+    public static final boolean getBoolean(byte[] buffer, int offset) {
+		if ( buffer[ offset ] == 0 ) { return false; }
+		else { return true; }
+    }
+	
     /**
      * Build a Java short from a 2-byte signed binary representation.
      *

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/am/Types.java Tue Dec 20 16:53:42 2005
@@ -19,6 +19,9 @@
 */
 package org.apache.derby.client.am;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
+import org.apache.derby.iapi.reference.JDBC30Translation;
+
 // This enumeration of types represents the typing scheme used by our jdbc driver.
 // Once this is finished, we need to review our switches to make sure they are exhaustive
 
@@ -31,6 +34,8 @@
     // Not currently supported as a DERBY column type.  Mapped to SMALLINT.
     //public final static int TINYINT 	= java.sql.Types.TINYINT;       // -6;
 
+    public final static int BOOLEAN = JDBC30Translation.BOOLEAN;       // 16;
+
     public final static int SMALLINT = java.sql.Types.SMALLINT;      // 5;
 
     public final static int INTEGER = java.sql.Types.INTEGER;       // 4;
@@ -73,54 +78,19 @@
 
     // hide the default constructor
     private Types() {
-    }
-
-    // -------------------------------- DERBY types ----------------------------------------------------
-
-    public final static int DERBY_SQLTYPE_DATE = 384;        // DATE
-    public final static int DERBY_SQLTYPE_NDATE = 385;
-    public final static int DERBY_SQLTYPE_TIME = 388;        // TIME
-    public final static int DERBY_SQLTYPE_NTIME = 389;
-    public final static int DERBY_SQLTYPE_TIMESTAMP = 392;   // TIMESTAMP
-    public final static int DERBY_SQLTYPE_NTIMESTAMP = 393;
-
-    public final static int DERBY_SQLTYPE_BLOB = 404;        // BLOB
-    public final static int DERBY_SQLTYPE_NBLOB = 405;
-    public final static int DERBY_SQLTYPE_CLOB = 408;        // CLOB
-    public final static int DERBY_SQLTYPE_NCLOB = 409;
-
-    public final static int DERBY_SQLTYPE_VARCHAR = 448;     // VARCHAR(i) - varying length string
-    public final static int DERBY_SQLTYPE_NVARCHAR = 449;
-    public final static int DERBY_SQLTYPE_CHAR = 452;        // CHAR(i) - fixed length
-    public final static int DERBY_SQLTYPE_NCHAR = 453;
-    public final static int DERBY_SQLTYPE_LONG = 456;        // LONG VARCHAR - varying length string
-    public final static int DERBY_SQLTYPE_NLONG = 457;
-    public final static int DERBY_SQLTYPE_CSTR = 460;        // SBCS - null terminated
-    public final static int DERBY_SQLTYPE_NCSTR = 461;
-
-    public final static int DERBY_SQLTYPE_FLOAT = 480;       // FLOAT - 4 or 8 byte floating point
-    public final static int DERBY_SQLTYPE_NFLOAT = 481;
-    public final static int DERBY_SQLTYPE_DECIMAL = 484;     // DECIMAL (m,n)
-    public final static int DERBY_SQLTYPE_NDECIMAL = 485;
-    public final static int DERBY_SQLTYPE_BIGINT = 492;      // BIGINT - 8-byte signed integer
-    public final static int DERBY_SQLTYPE_NBIGINT = 493;
-    public final static int DERBY_SQLTYPE_INTEGER = 496;     // INTEGER
-    public final static int DERBY_SQLTYPE_NINTEGER = 497;
-    public final static int DERBY_SQLTYPE_SMALL = 500;       // SMALLINT - 2-byte signed integer                                                                    */
-    public final static int DERBY_SQLTYPE_NSMALL = 501;
-
-    public final static int DERBY_SQLTYPE_NUMERIC = 504;     // NUMERIC -> DECIMAL (m,n)
-    public final static int DERBY_SQLTYPE_NNUMERIC = 505;
+   }
 
     static public int mapDERBYTypeToDriverType(boolean isDescribed, int sqlType, long length, int ccsid) {
         switch (Utils.getNonNullableSqlType(sqlType)) { // mask the isNullable bit
-        case DERBY_SQLTYPE_SMALL:
+        case DRDAConstants.DB2_SQLTYPE_BOOLEAN:
+            return BOOLEAN;
+        case DRDAConstants.DB2_SQLTYPE_SMALL:
             return SMALLINT;
-        case DERBY_SQLTYPE_INTEGER:
+        case DRDAConstants.DB2_SQLTYPE_INTEGER:
             return INTEGER;
-        case DERBY_SQLTYPE_BIGINT:
+        case DRDAConstants.DB2_SQLTYPE_BIGINT:
             return BIGINT;
-        case DERBY_SQLTYPE_FLOAT:
+        case DRDAConstants.DB2_SQLTYPE_FLOAT:
             if (length == 16)                  // can map to either NUMERIC or DECIMAL
             {
                 return DECIMAL;
@@ -132,39 +102,39 @@
             } else {
                 return 0;
             }
-        case DERBY_SQLTYPE_DECIMAL:            // can map to either NUMERIC or DECIMAL
-        case DERBY_SQLTYPE_NUMERIC:            // can map to either NUMERIC or DECIMAL
+        case DRDAConstants.DB2_SQLTYPE_DECIMAL:            // can map to either NUMERIC or DECIMAL
+        case DRDAConstants.DB2_SQLTYPE_NUMERIC:            // can map to either NUMERIC or DECIMAL
             return DECIMAL;
-        case DERBY_SQLTYPE_CHAR:    // mixed and single byte
+        case DRDAConstants.DB2_SQLTYPE_CHAR:    // mixed and single byte
             if (isDescribed && (ccsid == 0xffff || ccsid == 0)) {
                 return BINARY;
             } else {
                 return CHAR;
             }
-        case DERBY_SQLTYPE_CSTR:    // null terminated SBCS/Mixed
+        case DRDAConstants.DB2_SQLTYPE_CSTR:    // null terminated SBCS/Mixed
             return CHAR;
             // use ccsid to distinguish between BINARY and CHAR, VARBINARY and VARCHAR, LONG...
-        case DERBY_SQLTYPE_VARCHAR:   // variable character SBCS/Mixed
+        case DRDAConstants.DB2_SQLTYPE_VARCHAR:   // variable character SBCS/Mixed
             if (isDescribed && (ccsid == 0xffff || ccsid == 0)) {
                 return VARBINARY;
             } else {
                 return VARCHAR;
             }
-        case DERBY_SQLTYPE_LONG:      // long varchar SBCS/Mixed
+        case DRDAConstants.DB2_SQLTYPE_LONG:      // long varchar SBCS/Mixed
             if (isDescribed && (ccsid == 0xffff || ccsid == 0)) {
                 return LONGVARBINARY;
             } else {
                 return LONGVARCHAR;
             }
-        case DERBY_SQLTYPE_DATE:
+        case DRDAConstants.DB2_SQLTYPE_DATE:
             return DATE;
-        case DERBY_SQLTYPE_TIME:
+        case DRDAConstants.DB2_SQLTYPE_TIME:
             return TIME;
-        case DERBY_SQLTYPE_TIMESTAMP:
+        case DRDAConstants.DB2_SQLTYPE_TIMESTAMP:
             return TIMESTAMP;
-        case DERBY_SQLTYPE_CLOB:    // large object character SBCS/Mixed
+        case DRDAConstants.DB2_SQLTYPE_CLOB:    // large object character SBCS/Mixed
             return Types.CLOB;
-        case DERBY_SQLTYPE_BLOB:    // large object bytes
+        case DRDAConstants.DB2_SQLTYPE_BLOB:    // large object bytes
             return java.sql.Types.BLOB;
         default:
             return 0;

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/FdocaConstants.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/FdocaConstants.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/FdocaConstants.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/FdocaConstants.java Tue Dec 20 16:53:42 2005
@@ -55,78 +55,9 @@
     static final int FDOCA_TYPE_LOBCHAR = 0x51;
     static final int FDOCA_TYPE_NLOBCHAR = 0xD1;
 
-    // PROTOCOL Type constants.
-    static final int PROTOCOL_TYPE_INTEGER = 0x02;
-    static final int PROTOCOL_TYPE_NINTEGER = 0x03;
-    static final int PROTOCOL_TYPE_SMALL = 0x04;
-    static final int PROTOCOL_TYPE_NSMALL = 0x05;
-    static final int PROTOCOL_TYPE_1BYTE_INT = 0x06;
-    static final int PROTOCOL_TYPE_N1BYTE_INT = 0x07;
-    static final int PROTOCOL_TYPE_FLOAT16 = 0x08;
-    static final int PROTOCOL_TYPE_NFLOAT16 = 0x09;
-    static final int PROTOCOL_TYPE_FLOAT8 = 0x0A;
-    static final int PROTOCOL_TYPE_NFLOAT8 = 0x0B;
-    static final int PROTOCOL_TYPE_FLOAT4 = 0x0C;
-    static final int PROTOCOL_TYPE_NFLOAT4 = 0x0D;
-    static final int PROTOCOL_TYPE_DECIMAL = 0x0E;
-    static final int PROTOCOL_TYPE_NDECIMAL = 0x0F;
-    static final int PROTOCOL_TYPE_NUMERIC_CHAR = 0x12;
-    static final int PROTOCOL_TYPE_NNUMERIC_CHAR = 0x13;
-    static final int PROTOCOL_TYPE_RSET_LOC = 0x14;
-    static final int PROTOCOL_TYPE_NRSET_LOC = 0x15;
-    static final int PROTOCOL_TYPE_INTEGER8 = 0x16;
-    static final int PROTOCOL_TYPE_NINTEGER8 = 0x17;
-    static final int PROTOCOL_TYPE_LOBLOC = 0x18;
-    static final int PROTOCOL_TYPE_NLOBLOC = 0x19;
-    static final int PROTOCOL_TYPE_CLOBLOC = 0x1A;
-    static final int PROTOCOL_TYPE_NCLOBLOC = 0x1B;
-    static final int PROTOCOL_TYPE_DBCSCLOBLOC = 0x1C;
-    static final int PROTOCOL_TYPE_NDBCSCLOBLOC = 0x1D;
-    static final int PROTOCOL_TYPE_DATE = 0x20;
-    static final int PROTOCOL_TYPE_NDATE = 0x21;
-    static final int PROTOCOL_TYPE_TIME = 0x22;
-    static final int PROTOCOL_TYPE_NTIME = 0x23;
-    static final int PROTOCOL_TYPE_TIMESTAMP = 0x24;
-    static final int PROTOCOL_TYPE_NTIMESTAMP = 0x25;
-    static final int PROTOCOL_TYPE_FIXBYTE = 0x26;
-    static final int PROTOCOL_TYPE_NFIXBYTE = 0x27;
-    static final int PROTOCOL_TYPE_VARBYTE = 0x28;
-    static final int PROTOCOL_TYPE_NVARBYTE = 0x29;
-    static final int PROTOCOL_TYPE_LONGVARBYTE = 0x2A;
-    static final int PROTOCOL_TYPE_NLONGVARBYTE = 0x2B;
-    static final int PROTOCOL_TYPE_NTERMBYTE = 0x2C;
-    static final int PROTOCOL_TYPE_NNTERMBYTE = 0x2D;
-    static final int PROTOCOL_TYPE_CSTR = 0x2E;
-    static final int PROTOCOL_TYPE_NCSTR = 0x2F;
-    static final int PROTOCOL_TYPE_CHAR = 0x30;
-    static final int PROTOCOL_TYPE_NCHAR = 0x31;
-    static final int PROTOCOL_TYPE_VARCHAR = 0x32;
-    static final int PROTOCOL_TYPE_NVARCHAR = 0x33;
-    static final int PROTOCOL_TYPE_LONG = 0x34;
-    static final int PROTOCOL_TYPE_NLONG = 0x35;
-    static final int PROTOCOL_TYPE_MIX = 0x3C;
-    static final int PROTOCOL_TYPE_NMIX = 0x3D;
-    static final int PROTOCOL_TYPE_VARMIX = 0x3E;
-    static final int PROTOCOL_TYPE_NVARMIX = 0x3F;
-    static final int PROTOCOL_TYPE_LONGMIX = 0x40;
-    static final int PROTOCOL_TYPE_NLONGMIX = 0x41;
-    static final int PROTOCOL_TYPE_CSTRMIX = 0x42;
-    static final int PROTOCOL_TYPE_NCSTRMIX = 0x43;
-    static final int PROTOCOL_TYPE_PSCLBYTE = 0x44;
-    static final int PROTOCOL_TYPE_NPSCLBYTE = 0x45;
-
     // --- Override LIDs 0x50 - 0xAF
     static final int FIRST_OVERRIDE_LID = 0x50;
     static final int LAST_OVERRIDE_LID = 0xAF;
-
-    static final int PROTOCOL_TYPE_LOBBYTES = 0xC8;
-    static final int PROTOCOL_TYPE_NLOBBYTES = 0xC9;
-    static final int PROTOCOL_TYPE_LOBCSBCS = 0xCA;
-    static final int PROTOCOL_TYPE_NLOBCSBCS = 0xCB;
-    static final int PROTOCOL_TYPE_LOBCDBCS = 0xCC;
-    static final int PROTOCOL_TYPE_NLOBCDBCS = 0xCD;
-    static final int PROTOCOL_TYPE_LOBCMIXED = 0xCE;
-    static final int PROTOCOL_TYPE_NLOBCMIXED = 0xCF;
 
     static final int CPT_TRIPLET_TYPE = 0x7F;      // CPT triplet type
     static final int MDD_TRIPLET_TYPE = 0x78;      // MDD triplet type

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConfiguration.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConfiguration.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConfiguration.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConfiguration.java Tue Dec 20 16:53:42 2005
@@ -19,6 +19,7 @@
 */
 package org.apache.derby.client.net;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.client.am.Version;
 
 public class NetConfiguration {
@@ -197,7 +198,7 @@
         // mm = minor version
         // x = protocol MaintenanceVersion
 
-        String prdId = "DNC";
+        String prdId = DRDAConstants.DERBY_DRDA_CLIENT_ID;
         if (majorVersion < 10) {
             prdId += "0";
         }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetStatementRequest.java Tue Dec 20 16:53:42 2005
@@ -19,6 +19,7 @@
 */
 package org.apache.derby.client.net;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.client.am.Blob;
 import org.apache.derby.client.am.Clob;
 import org.apache.derby.client.am.ColumnMetaData;
@@ -653,8 +654,8 @@
                 }
 
                 switch (protocolTypesAndLengths[i][0] | 0x01) {  // mask out null indicator
-                case FdocaConstants.PROTOCOL_TYPE_NVARMIX:
-                case FdocaConstants.PROTOCOL_TYPE_NLONGMIX:
+                case DRDAConstants.DRDA_TYPE_NVARMIX:
+                case DRDAConstants.DRDA_TYPE_NLONGMIX:
                     // What to do for server that don't understand 1208 (UTF-8)
                     // check for a promototed type, and use that instead if it exists
                     o = retrievePromotedParameterIfExists(i);
@@ -667,8 +668,8 @@
                     }
                     break;
 
-                case FdocaConstants.PROTOCOL_TYPE_NVARCHAR:
-                case FdocaConstants.PROTOCOL_TYPE_NLONG:
+                case DRDAConstants.DRDA_TYPE_NVARCHAR:
+                case DRDAConstants.DRDA_TYPE_NLONG:
                     o = retrievePromotedParameterIfExists(i);
                     if (o == null) {
 
@@ -678,37 +679,37 @@
                     }
                     break;
 
-                case FdocaConstants.PROTOCOL_TYPE_NINTEGER:
+                case DRDAConstants.DRDA_TYPE_NINTEGER:
                     writeIntFdocaData(((Integer) inputs[i]).intValue());
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NSMALL:
+                case DRDAConstants.DRDA_TYPE_NSMALL:
                     writeShortFdocaData(((Short) inputs[i]).shortValue());
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NFLOAT4:
+                case DRDAConstants.DRDA_TYPE_NFLOAT4:
                     writeFloat(((Float) inputs[i]).floatValue());
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NFLOAT8:
+                case DRDAConstants.DRDA_TYPE_NFLOAT8:
                     writeDouble(((Double) inputs[i]).doubleValue());
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NDECIMAL:
+                case DRDAConstants.DRDA_TYPE_NDECIMAL:
                     writeBigDecimal((java.math.BigDecimal) inputs[i],
                             (protocolTypesAndLengths[i][1] >> 8) & 0xff, // described precision not actual
                             protocolTypesAndLengths[i][1] & 0xff); // described scale, not actual
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NDATE:
+                case DRDAConstants.DRDA_TYPE_NDATE:
                     writeDate((java.sql.Date) inputs[i]);
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NTIME:
+                case DRDAConstants.DRDA_TYPE_NTIME:
                     writeTime((java.sql.Time) inputs[i]);
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NTIMESTAMP:
+                case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
                     writeTimestamp((java.sql.Timestamp) inputs[i]);
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NINTEGER8:
+                case DRDAConstants.DRDA_TYPE_NINTEGER8:
                     writeLongFdocaData(((Long) inputs[i]).longValue());
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NVARBYTE:
-                case FdocaConstants.PROTOCOL_TYPE_NLONGVARBYTE:
+                case DRDAConstants.DRDA_TYPE_NVARBYTE:
+                case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
                     o = retrievePromotedParameterIfExists(i);
                     if (o == null) {
                         writeLDBytes((byte[]) inputs[i]);
@@ -718,8 +719,8 @@
                         setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
                     }
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NLOBCSBCS:
-                case FdocaConstants.PROTOCOL_TYPE_NLOBCDBCS:
+                case DRDAConstants.DRDA_TYPE_NLOBCSBCS:
+                case DRDAConstants.DRDA_TYPE_NLOBCDBCS:
                     // check for a promoted Clob
                     o = retrievePromotedParameterIfExists(i);
                     if (o == null) {
@@ -740,7 +741,7 @@
                     }
                     setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NLOBBYTES:
+                case DRDAConstants.DRDA_TYPE_NLOBBYTES:
                     // check for a promoted Clob
                     o = retrievePromotedParameterIfExists(i);
                     if (o == null) {
@@ -761,7 +762,7 @@
                     }
                     setFDODTALobLength(protocolTypesAndLengths, i, dataLength);
                     break;
-                case FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED:
+                case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
                     // check for a promoted Clob
                     o = retrievePromotedParameterIfExists(i);
                     if (o == null) {
@@ -1003,7 +1004,7 @@
                 // assumes UTF-8 characters at most 3 bytes long
                 // Flow the String as a VARCHAR
                 if (s == null || s.length() <= 32767 / 3) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NVARMIX;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARMIX;
                     lidAndLengths[i][1] = 32767;
                 } else {
                     // Flow the data as CLOB data if the data too large to for LONGVARCHAR
@@ -1018,7 +1019,7 @@
                         // NetStatementRequest use
                         promototedParameters_.put(new Integer(i), c);
 
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
                         lidAndLengths[i][1] = buildPlaceholderLength(c.length());
                     } catch (java.io.UnsupportedEncodingException e) {
                         throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
@@ -1028,29 +1029,32 @@
             case java.sql.Types.INTEGER:
                 // lid: PROTOCOL_TYPE_NINTEGER, length override: 4
                 // dataFormat: Integer
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NINTEGER;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER;
                 lidAndLengths[i][1] = 4;
                 break;
+            case java.sql.Types.BOOLEAN:
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NBOOLEAN;
+                lidAndLengths[i][1] = 1;
+                break;
             case java.sql.Types.SMALLINT:
             case java.sql.Types.TINYINT:
-            case java.sql.Types.BOOLEAN:
             case java.sql.Types.BIT:
                 // lid: PROTOCOL_TYPE_NSMALL,  length override: 2
                 // dataFormat: Short
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NSMALL;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NSMALL;
                 lidAndLengths[i][1] = 2;
                 break;
             case java.sql.Types.REAL:
                 // lid: PROTOCOL_TYPE_NFLOAT4, length override: 4
                 // dataFormat: Float
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NFLOAT4;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT4;
                 lidAndLengths[i][1] = 4;
                 break;
             case java.sql.Types.DOUBLE:
             case java.sql.Types.FLOAT:
                 // lid: PROTOCOL_TYPE_NFLOAT8, length override: 8
                 // dataFormat: Double
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NFLOAT8;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NFLOAT8;
                 lidAndLengths[i][1] = 8;
                 break;
             case java.sql.Types.NUMERIC:
@@ -1081,42 +1085,42 @@
                 // for decimal and blob columns only
                 int precision = parameterMetaData.sqlPrecision_[i];
                 int scale = parameterMetaData.sqlScale_[i];
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NDECIMAL;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDECIMAL;
                 lidAndLengths[i][1] = (precision << 8) + (scale << 0);
                 break;
             case java.sql.Types.DATE:
                 // for input, output, and inout parameters
                 // lid: PROTOCOL_TYPE_NDATE, length override: 8
                 // dataFormat: java.sql.Date
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NDATE;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NDATE;
                 lidAndLengths[i][1] = 10;
                 break;
             case java.sql.Types.TIME:
                 // for input, output, and inout parameters
                 // lid: PROTOCOL_TYPE_NTIME, length override: 8
                 // dataFormat: java.sql.Time
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NTIME;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIME;
                 lidAndLengths[i][1] = 8;
                 break;
             case java.sql.Types.TIMESTAMP:
                 // for input, output, and inout parameters
                 // lid: PROTOCOL_TYPE_NTIME, length overrid: 26
                 // dataFormat: java.sql.Timestamp
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NTIMESTAMP;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NTIMESTAMP;
                 lidAndLengths[i][1] = 26;
                 break;
             case java.sql.Types.BIGINT:
                 // if SQLAM < 6 this should be mapped to decimal (19,0) in common layer
                 // if SQLAM >=6, lid: PROTOCOL_TYPE_NINTEGER8, length override: 8
                 // dataFormat: Long
-                lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NINTEGER8;
+                lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NINTEGER8;
                 lidAndLengths[i][1] = 8;
                 break;
             case java.sql.Types.LONGVARCHAR:
                 // Is this the right thing to do  // should this be 32700
                 s = (String) inputRow[i];
                 if (s == null || s.length() <= 32767 / 3) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLONGMIX;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGMIX;
                     lidAndLengths[i][1] = 32767;
                 } else {
                     // Flow the data as CLOB data if the data too large to for LONGVARCHAR
@@ -1132,7 +1136,7 @@
                         // NetStatementRequest use
                         promototedParameters_.put(new Integer(i), c);
 
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
                         lidAndLengths[i][1] = buildPlaceholderLength(c.length());
                     } catch (java.io.UnsupportedEncodingException e) {
                         throw new SqlException(netAgent_.logWriter_, e, "Error in building String parameter: throwable attached");
@@ -1143,10 +1147,10 @@
             case java.sql.Types.VARBINARY:
                 byte[] ba = (byte[]) inputRow[i];
                 if (ba == null) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NVARBYTE;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
                     lidAndLengths[i][1] = 32767;
                 } else if (ba.length <= 32767) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NVARBYTE;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NVARBYTE;
                     lidAndLengths[i][1] = 32767;
                 } else {
                     // Promote to a BLOB. Only reach this path in the absence of describe information.
@@ -1157,17 +1161,17 @@
                     // NetStatementRequest use
                     promototedParameters_.put(new Integer(i), b);
 
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBBYTES;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
                     lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
                 }
                 break;
             case java.sql.Types.LONGVARBINARY:
                 ba = (byte[]) inputRow[i];
                 if (ba == null) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLONGVARBYTE;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
                     lidAndLengths[i][1] = 32767;
                 } else if (ba.length <= 32767) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLONGVARBYTE;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
                     lidAndLengths[i][1] = 32767;
                 } else {
                     // Promote to a BLOB. Only reach this path in the absensce of describe information.
@@ -1178,18 +1182,18 @@
                     // NetStatementRequest use
                     promototedParameters_.put(new Integer(i), b);
 
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBBYTES;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
                     lidAndLengths[i][1] = buildPlaceholderLength(ba.length);
                 }
                 break;
             case java.sql.Types.BLOB:
                 java.sql.Blob b = (java.sql.Blob) inputRow[i];
                 if (b == null) {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBBYTES;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
                     lidAndLengths[i][1] =
                             buildPlaceholderLength(parameterMetaData.sqlLength_[i]);
                 } else {
-                    lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBBYTES;
+                    lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBBYTES;
                     try {
                         lidAndLengths[i][1] = buildPlaceholderLength(b.length());
                     } catch (java.sql.SQLException e) {
@@ -1229,22 +1233,22 @@
                         lobLength = ((Clob) c).length();
                     }
                     if (c == null) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
                         lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
                     } else if (isExternalClob) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCDBCS;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
                         lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
                     } else if (((Clob) c).isCharacterStream()) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCDBCS;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCDBCS;
                         lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
                     } else if (((Clob) c).isUnicodeStream()) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
                         lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
                     } else if (((Clob) c).isAsciiStream()) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCSBCS;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCSBCS;
                         lidAndLengths[i][1] = buildPlaceholderLength(lobLength);
                     } else if (((Clob) c).isString()) {
-                        lidAndLengths[i][0] = FdocaConstants.PROTOCOL_TYPE_NLOBCMIXED;
+                        lidAndLengths[i][0] = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
                         lidAndLengths[i][1] = buildPlaceholderLength(((Clob) c).getUTF8Length());
                     }
                 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/Typdef.java Tue Dec 20 16:53:42 2005
@@ -20,6 +20,8 @@
 
 package org.apache.derby.client.net;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
+import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.client.am.Cursor;
 import org.apache.derby.client.am.DisconnectException;
 import org.apache.derby.client.am.SignedBinary;
@@ -254,6 +256,11 @@
         /* 0x5F */ 0
     };
 
+	//
+	// FIXME: Instead of magic numbers, the first arg in each of these
+	// constructor calls should be the corresponding constant from
+	// DRDAConstants.
+	//
     protected static final FdocaSimpleDataArray[] environmentTables_ = {
         /* 0x00 Empties */
         null,
@@ -671,6 +678,10 @@
         new FdocaSimpleDataArray(0xCE, FdocaConstants.FDOCA_TYPE_LOBCHAR, Cursor.MBCS_CLOB, CCSIDMBC, 1, 1, 8, LOBLENGTH),
         /* 0xCF null Large object char MBCS */
         new FdocaSimpleDataArray(0xCF, FdocaConstants.FDOCA_TYPE_NLOBCHAR, Cursor.MBCS_CLOB, CCSIDMBC, 1, 1, 8, LOBLENGTH),
+        /* 0xD0 boolean */
+        new FdocaSimpleDataArray(DRDAConstants.DRDA_TYPE_BOOLEAN, FdocaConstants.FDOCA_TYPE_INTEGER_BE, SignedBinary.BIG_ENDIAN, NOCCSID, 0, 0, 1, FIXEDLENGTH),
+        /* 0xD1 null boolean */
+        new FdocaSimpleDataArray(DRDAConstants.DRDA_TYPE_NBOOLEAN, FdocaConstants.FDOCA_TYPE_NINTEGER_BE, SignedBinary.BIG_ENDIAN, NOCCSID, 0, 0, 1, FIXEDLENGTH),
     };
 
     private static final int[] protocolToJdbcTypes_ = {
@@ -883,6 +894,8 @@
         0x00,
         java.sql.Types.CLOB, // 0xCE Large object char MBCS
         java.sql.Types.CLOB, // 0xCF null Large object char MBCS
+		JDBC30Translation.BOOLEAN, // 0xD0 boolean
+		JDBC30Translation.BOOLEAN, // 0xD1 null boolean
     };
 
 

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/AppRequester.java Tue Dec 20 16:53:42 2005
@@ -20,6 +20,7 @@
 
 package org.apache.derby.impl.drda;
 import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.iapi.reference.Limits;
 
 /**
@@ -52,6 +53,7 @@
 											5, // SYNCPTMGR
 											0  // XAMGR
 											};
+	
 	// Application requester information
 	protected String	extnam;			// External Name - EXCSAT
 	protected String	srvnam;			// Server Name - EXCSAT
@@ -105,13 +107,29 @@
 		releaseLevel = Integer.parseInt(prdid.substring (5, 7));
 		modifyLevel = Integer.parseInt(prdid.substring (7, 8));
 		if (srvrlslv == null)
-			clientType = UNKNOWN_CLIENT;
+		{ clientType = UNKNOWN_CLIENT; }
 		else if (srvrlslv.indexOf("JCC") != -1)
-			clientType = JCC_CLIENT;
-		else if (srvrlslv.indexOf("DNC") != -1)
-			clientType = DNC_CLIENT;
+		{ clientType = JCC_CLIENT; }
+		else if
+			(
+			    (srvrlslv.indexOf(DRDAConstants.DERBY_DRDA_CLIENT_ID) != -1)
+			)
+		{ clientType = DNC_CLIENT; }
 		else
-			clientType = UNKNOWN_CLIENT;
+		{ clientType = UNKNOWN_CLIENT; }
+	}
+
+	/**
+	 * Returns true if the client supports Derby's protocol for
+	 * transmitting BOOLEAN values.
+	 */
+	protected	boolean	supportsBoolean()
+	{
+		return
+			(
+			    ( clientType == DNC_CLIENT ) &&
+			    ( greaterThanOrEqualTo( 10, 2, 0 ) )
+			);
 	}
 
 	/**

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java?rev=358163&r1=358162&r2=358163&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 Tue Dec 20 16:53:42 2005
@@ -46,6 +46,7 @@
 
 import org.apache.derby.iapi.error.ExceptionSeverity;
 import org.apache.derby.iapi.reference.Attribute;
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.iapi.reference.JDBC30Translation;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.info.JVMInfo;
@@ -3996,7 +3997,7 @@
 
 		switch (drdaType)
 		{
-			case FdocaConstants.DRDA_TYPE_NSMALL:
+			case DRDAConstants.DRDA_TYPE_NSMALL:
 			{
 				short paramVal = (short) reader.readShort(getByteOrder());
 				if (SanityManager.DEBUG)
@@ -4008,7 +4009,7 @@
 					ps.setShort(i+1, paramVal);
 				break;
 			}
-			case  FdocaConstants.DRDA_TYPE_NINTEGER:
+			case  DRDAConstants.DRDA_TYPE_NINTEGER:
 			{
 				int paramVal = reader.readInt(getByteOrder());
 				if (SanityManager.DEBUG)
@@ -4016,7 +4017,7 @@
 				ps.setInt(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NINTEGER8:
+			case DRDAConstants.DRDA_TYPE_NINTEGER8:
 			{
 				long paramVal = reader.readLong(getByteOrder());
 				if (SanityManager.DEBUG)
@@ -4024,7 +4025,7 @@
 				ps.setLong(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NFLOAT4:
+			case DRDAConstants.DRDA_TYPE_NFLOAT4:
 			{
 				float paramVal = reader.readFloat(getByteOrder());
 				if (SanityManager.DEBUG) 
@@ -4032,7 +4033,7 @@
 				ps.setFloat(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NFLOAT8:
+			case DRDAConstants.DRDA_TYPE_NFLOAT8:
 			{
 				double paramVal = reader.readDouble(getByteOrder());
 				if (SanityManager.DEBUG) 
@@ -4040,7 +4041,7 @@
 				ps.setDouble(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NDECIMAL:
+			case DRDAConstants.DRDA_TYPE_NDECIMAL:
 			{
 				int precision = (paramLenNumBytes >> 8) & 0xff;
 				int scale = paramLenNumBytes & 0xff;
@@ -4050,7 +4051,7 @@
 				ps.setBigDecimal(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NDATE:
+			case DRDAConstants.DRDA_TYPE_NDATE:
 			{
 				String paramVal = reader.readStringData(10).trim();  //parameter may be char value
 				if (SanityManager.DEBUG) 
@@ -4068,7 +4069,7 @@
 				}
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NTIME:
+			case DRDAConstants.DRDA_TYPE_NTIME:
 			{
 				String paramVal = reader.readStringData(8).trim();  //parameter may be char value
 				if (SanityManager.DEBUG) 
@@ -4081,7 +4082,7 @@
 				}
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NTIMESTAMP:
+			case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
 			{
 				// JCC represents ts in a slightly different format than Java standard, so
 				// we do the conversion to Java standard here.
@@ -4106,11 +4107,11 @@
 				}
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NCHAR:
-			case FdocaConstants.DRDA_TYPE_NVARCHAR:
-			case FdocaConstants.DRDA_TYPE_NLONG:
-			case FdocaConstants.DRDA_TYPE_NVARMIX:
-			case FdocaConstants.DRDA_TYPE_NLONGMIX:
+			case DRDAConstants.DRDA_TYPE_NCHAR:
+			case DRDAConstants.DRDA_TYPE_NVARCHAR:
+			case DRDAConstants.DRDA_TYPE_NLONG:
+			case DRDAConstants.DRDA_TYPE_NVARMIX:
+			case DRDAConstants.DRDA_TYPE_NLONGMIX:
 			{
 				String paramVal = reader.readLDStringData(stmt.ccsidMBCEncoding);
 				if (SanityManager.DEBUG)
@@ -4118,7 +4119,7 @@
 				ps.setString(i+1, paramVal);
 				break;
 			}
-			case  FdocaConstants.DRDA_TYPE_NFIXBYTE:
+			case  DRDAConstants.DRDA_TYPE_NFIXBYTE:
 			{
 				byte[] paramVal = reader.readBytes();
 				if (SanityManager.DEBUG) 
@@ -4126,8 +4127,8 @@
 				ps.setBytes(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NVARBYTE:
-			case FdocaConstants.DRDA_TYPE_NLONGVARBYTE:
+			case DRDAConstants.DRDA_TYPE_NVARBYTE:
+			case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
 			{
 				int length = reader.readNetworkShort();	//protocol control data always follows big endian
 				if (SanityManager.DEBUG)
@@ -4136,10 +4137,10 @@
 				ps.setBytes(i+1, paramVal);
 				break;
 			}
-			case FdocaConstants.DRDA_TYPE_NLOBBYTES:
-			case FdocaConstants.DRDA_TYPE_NLOBCMIXED:
-			case FdocaConstants.DRDA_TYPE_NLOBCSBCS:
-			case FdocaConstants.DRDA_TYPE_NLOBCDBCS:
+			case DRDAConstants.DRDA_TYPE_NLOBBYTES:
+			case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
+			case DRDAConstants.DRDA_TYPE_NLOBCSBCS:
+			case DRDAConstants.DRDA_TYPE_NLOBCDBCS:
 			 {
 				 long length = readLobLength(paramLenNumBytes);
 				 if (length != 0) //can be -1 for CLI if "data at exec" mode, see clifp/exec test
@@ -4150,7 +4151,7 @@
 				 }
 				 else   /* empty */
 				 {
-					if (drdaType == FdocaConstants.DRDA_TYPE_NLOBBYTES)
+					if (drdaType == DRDAConstants.DRDA_TYPE_NLOBBYTES)
 						ps.setBytes(i+1, new byte[0]);
 					else
 						ps.setString(i+1, "");
@@ -4237,28 +4238,28 @@
 				String paramString = null;
 				switch (drdaType)
 				{
-					case  FdocaConstants.DRDA_TYPE_LOBBYTES:
-					case  FdocaConstants.DRDA_TYPE_NLOBBYTES:
+					case  DRDAConstants.DRDA_TYPE_LOBBYTES:
+					case  DRDAConstants.DRDA_TYPE_NLOBBYTES:
 						if (SanityManager.DEBUG)
 							trace("parameter value is: "+paramBytes);
 						ps.setBytes(i+1, paramBytes);
 						break;
-					case FdocaConstants.DRDA_TYPE_LOBCSBCS:
-					case FdocaConstants.DRDA_TYPE_NLOBCSBCS:
+					case DRDAConstants.DRDA_TYPE_LOBCSBCS:
+					case DRDAConstants.DRDA_TYPE_NLOBCSBCS:
 						paramString = new String(paramBytes, stmt.ccsidSBCEncoding);
 						if (SanityManager.DEBUG)
 							trace("parameter value is: "+ paramString);
 						ps.setString(i+1,paramString);
 						break;
-					case FdocaConstants.DRDA_TYPE_LOBCDBCS:
-					case FdocaConstants.DRDA_TYPE_NLOBCDBCS:
+					case DRDAConstants.DRDA_TYPE_LOBCDBCS:
+					case DRDAConstants.DRDA_TYPE_NLOBCDBCS:
 						paramString = new String(paramBytes, stmt.ccsidDBCEncoding );
 						if (SanityManager.DEBUG)
 							trace("parameter value is: "+ paramString);
 						ps.setString(i+1,paramString);
 						break;
-					case FdocaConstants.DRDA_TYPE_LOBCMIXED:
-					case FdocaConstants.DRDA_TYPE_NLOBCMIXED:
+					case DRDAConstants.DRDA_TYPE_LOBCMIXED:
+					case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
 						paramString = new String(paramBytes, stmt.ccsidMBCEncoding);
 						if (SanityManager.DEBUG)
 							trace("parameter value is: "+ paramString);
@@ -5766,10 +5767,11 @@
 												 (pmeta.isNullable(i) == JDBC30Translation.PARAMETER_NULLABLE));
 			int colType = (hasRs ? rsmeta.getColumnType(i) : pmeta.getParameterType(i));
 			int[] outlen = {-1};
-			int drdaType = (hasRs ?FdocaConstants.mapJdbcTypeToDrdaType(colType,nullable,outlen): 
-								stmt.getParamDRDAType(i));
+			int drdaType =
+				(hasRs ?FdocaConstants.mapJdbcTypeToDrdaType(appRequester,colType,nullable,outlen): 
+				 stmt.getParamDRDAType(i));
 
-			boolean isDecimal = ((drdaType | 1) == FdocaConstants.DRDA_TYPE_NDECIMAL);
+			boolean isDecimal = ((drdaType | 1) == DRDAConstants.DRDA_TYPE_NDECIMAL);
 			int precision = 0, scale = 0;
 			if (hasRs)
 			{
@@ -6082,14 +6084,14 @@
 					 			 "precision = " + precision +" scale = " + scale);
 					switch (ndrdaType)
 					{
-						case FdocaConstants.DRDA_TYPE_NLOBBYTES:
-						case  FdocaConstants.DRDA_TYPE_NLOBCMIXED:
+						case DRDAConstants.DRDA_TYPE_NLOBBYTES:
+						case  DRDAConstants.DRDA_TYPE_NLOBCMIXED:
 							EXTDTAInputStream extdtaStream=  
 								EXTDTAInputStream.getEXTDTAStream(rs, i, drdaType);
 							writeFdocaVal(i,extdtaStream, drdaType,
 										  precision,scale,rs.wasNull(),stmt);
 							break;
-						case FdocaConstants.DRDA_TYPE_NINTEGER:
+						case DRDAConstants.DRDA_TYPE_NINTEGER:
 							int ival = rs.getInt(i);
 							valNull = rs.wasNull();
 							if (SanityManager.DEBUG)
@@ -6098,7 +6100,7 @@
 							if (! valNull)
 								writer.writeInt(ival);
 							break;
-						case FdocaConstants.DRDA_TYPE_NSMALL:
+						case DRDAConstants.DRDA_TYPE_NSMALL:
 							short sval = rs.getShort(i);
 							valNull = rs.wasNull();
 							if (SanityManager.DEBUG)
@@ -6107,7 +6109,7 @@
 							if (! valNull)
 								writer.writeShort(sval);
 							break;
-						case FdocaConstants.DRDA_TYPE_NINTEGER8:
+						case DRDAConstants.DRDA_TYPE_NINTEGER8:
 							long lval = rs.getLong(i);
 							valNull = rs.wasNull();
 							if (SanityManager.DEBUG)
@@ -6116,7 +6118,7 @@
 							if (! valNull)
 								writer.writeLong(lval);
 							break;
-						case FdocaConstants.DRDA_TYPE_NFLOAT4:
+						case DRDAConstants.DRDA_TYPE_NFLOAT4:
 							float fval = rs.getFloat(i);
 							valNull = rs.wasNull();
 							if (SanityManager.DEBUG)
@@ -6125,7 +6127,7 @@
 							if (! valNull)
 								writer.writeFloat(fval);
 							break;
-						case FdocaConstants.DRDA_TYPE_NFLOAT8:
+						case DRDAConstants.DRDA_TYPE_NFLOAT8:
 							double dval = rs.getDouble(i);
 							valNull = rs.wasNull();
 							if (SanityManager.DEBUG)
@@ -6134,11 +6136,11 @@
 							if (! valNull)
 								writer.writeDouble(dval);
 							break;
-						case FdocaConstants.DRDA_TYPE_NCHAR:
-						case FdocaConstants.DRDA_TYPE_NVARCHAR:
-						case FdocaConstants.DRDA_TYPE_NVARMIX:
-						case FdocaConstants.DRDA_TYPE_NLONG:
-						case FdocaConstants.DRDA_TYPE_NLONGMIX:
+						case DRDAConstants.DRDA_TYPE_NCHAR:
+						case DRDAConstants.DRDA_TYPE_NVARCHAR:
+						case DRDAConstants.DRDA_TYPE_NVARMIX:
+						case DRDAConstants.DRDA_TYPE_NLONG:
+						case DRDAConstants.DRDA_TYPE_NLONGMIX:
 							String valStr = rs.getString(i);
 							if (SanityManager.DEBUG)
 								trace("====== writing char/varchar/mix :"+ valStr + ":");
@@ -6462,7 +6464,8 @@
 										ResultSetMetaData.columnNullable) : 
 			(pmeta.isNullable(jdbcElemNum) == JDBC30Translation.PARAMETER_NULLABLE);
 		
-		int sqlType = SQLTypes.mapJdbcTypeToDB2SqlType(elemType,
+		int sqlType = SQLTypes.mapJdbcTypeToDB2SqlType(appRequester,
+													   elemType,
 													   nullable,
 													   outlen);
 		
@@ -6686,7 +6689,10 @@
 			long valLength = 0;
 			switch (ndrdaType)
 			{
-			case FdocaConstants.DRDA_TYPE_NSMALL:
+			    case DRDAConstants.DRDA_TYPE_NBOOLEAN:
+					writer.writeByte( makeInt( (Boolean) val ) );
+					break;
+			    case DRDAConstants.DRDA_TYPE_NSMALL:
  					// DB2 does not have a BOOLEAN java.sql.bit type,
 					// so we need to send it as a small
  					if (val instanceof Boolean)
@@ -6700,31 +6706,31 @@
 					else
  						writer.writeShort(((Integer) val).shortValue());
 					break;
-				case  FdocaConstants.DRDA_TYPE_NINTEGER:
+				case  DRDAConstants.DRDA_TYPE_NINTEGER:
 					writer.writeInt(((Integer) val).intValue());
 					break;
-				case FdocaConstants.DRDA_TYPE_NINTEGER8:
+				case DRDAConstants.DRDA_TYPE_NINTEGER8:
 					writer.writeLong(((Long) val).longValue());
 					break;
-				case FdocaConstants.DRDA_TYPE_NFLOAT4:
+				case DRDAConstants.DRDA_TYPE_NFLOAT4:
 					writer.writeFloat(((Float) val).floatValue());
 					break;
-				case FdocaConstants.DRDA_TYPE_NFLOAT8:
+				case DRDAConstants.DRDA_TYPE_NFLOAT8:
 					writer.writeDouble(((Double) val).doubleValue());
 					break;
-				case FdocaConstants.DRDA_TYPE_NDECIMAL:
+				case DRDAConstants.DRDA_TYPE_NDECIMAL:
 					if (precision == 0)
 						precision = FdocaConstants.NUMERIC_DEFAULT_PRECISION;
 					BigDecimal bd = (java.math.BigDecimal) val;
 					writer.writeBigDecimal(bd,precision,scale);
 					break;
-				case FdocaConstants.DRDA_TYPE_NDATE:
+				case DRDAConstants.DRDA_TYPE_NDATE:
 					writer.writeString(((java.sql.Date) val).toString());
 					break;
-				case FdocaConstants.DRDA_TYPE_NTIME:
+				case DRDAConstants.DRDA_TYPE_NTIME:
 					writer.writeString(((java.sql.Time) val).toString());
 					break;
-				case FdocaConstants.DRDA_TYPE_NTIMESTAMP:
+				case DRDAConstants.DRDA_TYPE_NTIMESTAMP:
 					// we need to send it in a slightly different format, and pad it
 					// up to or truncate it into 26 chars
 					String ts1 = ((java.sql.Timestamp) val).toString();
@@ -6739,30 +6745,30 @@
 						ts2 = ts2.substring(0,26);
 					writer.writeString(ts2);
 					break;
-				case FdocaConstants.DRDA_TYPE_NCHAR:
+				case DRDAConstants.DRDA_TYPE_NCHAR:
 					writer.writeString(((String) val).toString());
 					break;
-				case FdocaConstants.DRDA_TYPE_NVARCHAR:
-				case FdocaConstants.DRDA_TYPE_NVARMIX:
-				case FdocaConstants.DRDA_TYPE_NLONG:
-				case FdocaConstants.DRDA_TYPE_NLONGMIX:
+				case DRDAConstants.DRDA_TYPE_NVARCHAR:
+				case DRDAConstants.DRDA_TYPE_NVARMIX:
+				case DRDAConstants.DRDA_TYPE_NLONG:
+				case DRDAConstants.DRDA_TYPE_NLONGMIX:
 					//WriteLDString and generate warning if truncated
 					// which will be picked up by checkWarning()
 					writer.writeLDString(val.toString(), index);
 					break;
-				case FdocaConstants.DRDA_TYPE_NLOBBYTES:
-				case FdocaConstants.DRDA_TYPE_NLOBCMIXED:
+				case DRDAConstants.DRDA_TYPE_NLOBBYTES:
+				case DRDAConstants.DRDA_TYPE_NLOBCMIXED:
 					// do not send EXTDTA for lob of length 0, beetle 5967
 					valLength = ((EXTDTAInputStream) val).length();
 					if (valLength > 0)
 						stmt.addExtDtaObject(val, index);
 					writer.writeExtendedLength (valLength);
 					break;
-				case  FdocaConstants.DRDA_TYPE_NFIXBYTE:
+				case  DRDAConstants.DRDA_TYPE_NFIXBYTE:
 					writer.writeBytes((byte[]) val);
 					break;
-				case FdocaConstants.DRDA_TYPE_NVARBYTE:
-				case FdocaConstants.DRDA_TYPE_NLONGVARBYTE:
+				case DRDAConstants.DRDA_TYPE_NVARBYTE:
+				case DRDAConstants.DRDA_TYPE_NLONGVARBYTE:
 						writer.writeLDBytes((byte[]) val, index);
 					break;
 				default:
@@ -6771,6 +6777,17 @@
 					writer.writeLDString(val.toString(), index);
 			}
 		}
+	}
+
+ 	/**
+	 * turn a boolean into an int
+	 * @param val	boolean value
+	 * 
+	 **/
+	private	int	makeInt( Boolean val )
+	{
+		if ( val.booleanValue() ) { return 1; }
+		else { return 0; }
 	}
 
 	/**

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/EXTDTAInputStream.java Tue Dec 20 16:53:42 2005
@@ -25,6 +25,7 @@
 import java.sql.ResultSet;
 import java.sql.SQLException;
 
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.impl.jdbc.Util;
 
@@ -74,10 +75,10 @@
 	 *            column number
 	 * @param drdaType
 	 *            FD:OCA type of object one of
-	 * 			   FdocaConstants.DRDA_TYPE_NLOBBYTES
-	 * 			   FdocaConstants.DRDA_TYPE_LOBBYTES
-	 * 			   FdocaConstants.DRDA_TYPE_NLOBCMIXED
-	 *  		   FdocaConstants.DRDA_TYPE_LOBCMIXED
+	 * 			   DRDAConstants.DRDA_TYPE_NLOBBYTES
+	 * 			   DRDAConstants.DRDA_TYPE_LOBBYTES
+	 * 			   DRDAConstants.DRDA_TYPE_NLOBCMIXED
+	 *  		   DRDAConstants.DRDA_TYPE_LOBCMIXED
 	 * 
 	 * @returns null if the value is null or a new EXTDTAInputStream corresponding to 
 	 *  		rs.getBinaryStream(column) value and associated length
@@ -93,7 +94,7 @@
 		
 		int ndrdaType = drdaType | 1; //nullable drdaType
 		// BLOBS
-		if (ndrdaType == FdocaConstants.DRDA_TYPE_NLOBBYTES) 
+		if (ndrdaType == DRDAConstants.DRDA_TYPE_NLOBBYTES) 
 		{
 			//TODO: Change to just use rs.getBinaryStream() by 
 			// eliminating the need for a length parameter in
@@ -102,7 +103,7 @@
 			
 		}
 		// CLOBS
-		else if (ndrdaType ==  FdocaConstants.DRDA_TYPE_NLOBCMIXED)
+		else if (ndrdaType ==  DRDAConstants.DRDA_TYPE_NLOBCMIXED)
 		{	
 			//TODO: Change to use getCharacterStream and change the read method
 			// to stream the data after length is no longer needed in DDMWRiter.writeScalarStream

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/FdocaConstants.java Tue Dec 20 16:53:42 2005
@@ -21,140 +21,16 @@
 
 import java.sql.Types;
 import org.apache.derby.iapi.reference.JDBC30Translation;
+import org.apache.derby.iapi.reference.DRDAConstants;
 import java.sql.SQLException;
 import org.apache.derby.iapi.reference.Limits;
 
 class FdocaConstants
 {
-// DRDA FD:OCA constants.
-  static final int FDOCA_TYPE_FIXEDBYTES = 0x01;
-  static final int FDOCA_TYPE_NFIXEDBYTES = 0x81;
-  static final int FDOCA_TYPE_VARBYTES = 0x02;
-  static final int FDOCA_TYPE_NVARBYTES = 0x82;
-  static final int FDOCA_TYPE_NTBYTES = 0x03;
-  static final int FDOCA_TYPE_NNTBYTES = 0x83;
-  static final int FDOCA_TYPE_PSCLBYTE = 0x07;
-  static final int FDOCA_TYPE_NPSCLBYTE = 0x87;
-  static final int FDOCA_TYPE_FIXEDCHAR = 0x10;
-  static final int FDOCA_TYPE_NFIXEDCHAR = 0x90;
-  static final int FDOCA_TYPE_VARCHAR = 0x11;
-  static final int FDOCA_TYPE_NVARCHAR = 0x91;
-  static final int FDOCA_TYPE_NTCHAR = 0x14;
-  static final int FDOCA_TYPE_NNTCHAR = 0x94;
-  static final int FDOCA_TYPE_PSCLCHAR = 0x19;
-  static final int FDOCA_TYPE_NPSCLCHAR = 0x99;
-  static final int FDOCA_TYPE_INTEGER_BE = 0x23;
-  static final int FDOCA_TYPE_NINTEGER_BE = 0xA3;
-  static final int FDOCA_TYPE_INTEGER_LE = 0x24;
-  static final int FDOCA_TYPE_NINTEGER_LE = 0xA4;
-  static final int FDOCA_TYPE_DECIMAL = 0x30;
-  static final int FDOCA_TYPE_NDECIMAL = 0xB0;
-  static final int FDOCA_TYPE_NUMERIC_CHAR = 0x32;
-  static final int FDOCA_TYPE_NNUMERIC_CHAR = 0xB2;
-  static final int FDOCA_TYPE_ZDECIMAL_IBM = 0x33;   //370, 390, zOS and 400
-  static final int FDOCA_TYPE_NZDECIMAL_IBM = 0xB3;  //370, 390, zOS and 400
-  static final int FDOCA_TYPE_ZDECIMAL = 0x35;
-  static final int FDOCA_TYPE_NZDECIMAL = 0xB5;
-  static final int FDOCA_TYPE_FLOAT_370 = 0x40;
-  static final int FDOCA_TYPE_NFLOAT_370 = 0xC0;
-  static final int FDOCA_TYPE_FLOAT_X86 = 0x47;
-  static final int FDOCA_TYPE_NFLOAT_X86 = 0xC7;
-  static final int FDOCA_TYPE_FLOAT_IEEE = 0x48;   //including 400
-  static final int FDOCA_TYPE_NFLOAT_IEEE = 0xC8;  //including 400
-  static final int FDOCA_TYPE_FLOAT_VAX = 0x49;
-  static final int FDOCA_TYPE_NFLOAT_VAX = 0xC9;
-  static final int FDOCA_TYPE_LOBBYTES = 0x50;
-  static final int FDOCA_TYPE_NLOBBYTES = 0xD0;
-  static final int FDOCA_TYPE_LOBCHAR = 0x51;
-  static final int FDOCA_TYPE_NLOBCHAR = 0xD1;
-
-  // DRDA Type constants.
-  static final int DRDA_TYPE_INTEGER = 0x02;
-  static final int DRDA_TYPE_NINTEGER = 0x03;
-  static final int DRDA_TYPE_SMALL = 0x04;
-  static final int DRDA_TYPE_NSMALL = 0x05;
-  static final int DRDA_TYPE_1BYTE_INT = 0x06;
-  static final int DRDA_TYPE_N1BYTE_INT = 0x07;
-  static final int DRDA_TYPE_FLOAT16 = 0x08;
-  static final int DRDA_TYPE_NFLOAT16 = 0x09;
-  static final int DRDA_TYPE_FLOAT8 = 0x0A;
-  static final int DRDA_TYPE_NFLOAT8 = 0x0B;
-  static final int DRDA_TYPE_FLOAT4 = 0x0C;
-  static final int DRDA_TYPE_NFLOAT4 = 0x0D;
-  static final int DRDA_TYPE_DECIMAL = 0x0E;
-  static final int DRDA_TYPE_NDECIMAL = 0x0F;
-  static final int DRDA_TYPE_ZDECIMAL = 0x10;
-  static final int DRDA_TYPE_NZDECIMAL = 0x11;
-  static final int DRDA_TYPE_NUMERIC_CHAR = 0x12;
-  static final int DRDA_TYPE_NNUMERIC_CHAR = 0x13;
-  static final int DRDA_TYPE_RSET_LOC = 0x14;
-  static final int DRDA_TYPE_NRSET_LOC = 0x15;
-  static final int DRDA_TYPE_INTEGER8 = 0x16;
-  static final int DRDA_TYPE_NINTEGER8 = 0x17;
-  static final int DRDA_TYPE_LOBLOC = 0x18;
-  static final int DRDA_TYPE_NLOBLOC = 0x19;
-  static final int DRDA_TYPE_CLOBLOC = 0x1A;
-  static final int DRDA_TYPE_NCLOBLOC = 0x1B;
-  static final int DRDA_TYPE_DBCSCLOBLOC = 0x1C;
-  static final int DRDA_TYPE_NDBCSCLOBLOC = 0x1D;
-  static final int DRDA_TYPE_ROWID = 0x1E;
-  static final int DRDA_TYPE_NROWID = 0x1F;
-  static final int DRDA_TYPE_DATE = 0x20;
-  static final int DRDA_TYPE_NDATE = 0x21;
-  static final int DRDA_TYPE_TIME = 0x22;
-  static final int DRDA_TYPE_NTIME = 0x23;
-  static final int DRDA_TYPE_TIMESTAMP = 0x24;
-  static final int DRDA_TYPE_NTIMESTAMP = 0x25;
-  static final int DRDA_TYPE_FIXBYTE = 0x26;
-  static final int DRDA_TYPE_NFIXBYTE = 0x27;
-  static final int DRDA_TYPE_VARBYTE = 0x28;
-  static final int DRDA_TYPE_NVARBYTE = 0x29;
-  static final int DRDA_TYPE_LONGVARBYTE = 0x2A;
-  static final int DRDA_TYPE_NLONGVARBYTE = 0x2B;
-  static final int DRDA_TYPE_NTERMBYTE = 0x2C;
-  static final int DRDA_TYPE_NNTERMBYTE = 0x2D;
-  static final int DRDA_TYPE_CSTR = 0x2E;
-  static final int DRDA_TYPE_NCSTR = 0x2F;
-  static final int DRDA_TYPE_CHAR = 0x30;
-  static final int DRDA_TYPE_NCHAR = 0x31;
-  static final int DRDA_TYPE_VARCHAR = 0x32;
-  static final int DRDA_TYPE_NVARCHAR = 0x33;
-  static final int DRDA_TYPE_LONG = 0x34;
-  static final int DRDA_TYPE_NLONG = 0x35;
-  static final int DRDA_TYPE_GRAPHIC = 0x36;
-  static final int DRDA_TYPE_NGRAPHIC = 0x37;
-  static final int DRDA_TYPE_VARGRAPH = 0x38;
-  static final int DRDA_TYPE_NVARGRAPH = 0x39;
-  static final int DRDA_TYPE_LONGRAPH = 0x3A;
-  static final int DRDA_TYPE_NLONGRAPH = 0x3B;
-  static final int DRDA_TYPE_MIX = 0x3C;
-  static final int DRDA_TYPE_NMIX = 0x3D;
-  static final int DRDA_TYPE_VARMIX = 0x3E;
-  static final int DRDA_TYPE_NVARMIX = 0x3F;
-  static final int DRDA_TYPE_LONGMIX = 0x40;
-  static final int DRDA_TYPE_NLONGMIX = 0x41;
-  static final int DRDA_TYPE_CSTRMIX = 0x42;
-  static final int DRDA_TYPE_NCSTRMIX = 0x43;
-  static final int DRDA_TYPE_PSCLBYTE = 0x44;
-  static final int DRDA_TYPE_NPSCLBYTE = 0x45;
-  static final int DRDA_TYPE_LSTR = 0x46;
-  static final int DRDA_TYPE_NLSTR = 0x47;
-  static final int DRDA_TYPE_LSTRMIX = 0x48;
-  static final int DRDA_TYPE_NLSTRMIX = 0x49;
-  static final int DRDA_TYPE_SDATALINK = 0x4C;
-  static final int DRDA_TYPE_NSDATALINK = 0x4D;
-  static final int DRDA_TYPE_MDATALINK = 0x4E;
-  static final int DRDA_TYPE_NMDATALINK = 0x4F;
-
-  // --- Override LIDs 0x50 - 0xAF
-  static final int DRDA_TYPE_LOBBYTES = 0xC8;
-  static final int DRDA_TYPE_NLOBBYTES = 0xC9;
-  static final int DRDA_TYPE_LOBCSBCS = 0xCA;
-  static final int DRDA_TYPE_NLOBCSBCS = 0xCB;
-  static final int DRDA_TYPE_LOBCDBCS = 0xCC;
-  static final int DRDA_TYPE_NLOBCDBCS = 0xCD;
-  static final int DRDA_TYPE_LOBCMIXED = 0xCE;
-  static final int DRDA_TYPE_NLOBCMIXED = 0xCF;
+  //
+  // This is where DRDA FD:OCA constants used to live. They were removed
+  // because they were not referenced anywhere.
+  //
 
   static final int CPT_TRIPLET_TYPE = 0x7F;      // CPT triplet type
   static final int MDD_TRIPLET_TYPE = 0x78;      // MDD triplet type
@@ -256,95 +132,99 @@
 	 * @param outlen - output parameter with length of type.
 	 * @return standard drdaTypeLength. -1 if we don't know.
 	 **/
-	protected static int mapJdbcTypeToDrdaType(int jdbcType, boolean nullable,
+	protected static int mapJdbcTypeToDrdaType(AppRequester appRequester, int jdbcType, boolean nullable,
 											   int[] outlen)
 		throws SQLException
 	{
+		jdbcType = clipJdbcType( appRequester, jdbcType );
 
 		int drdaType = 0;
 		switch (jdbcType) {
 			case JDBC30Translation.BOOLEAN:
+				drdaType = DRDAConstants.DRDA_TYPE_NBOOLEAN;
+				outlen[0] = 1;
+				break;
 			case java.sql.Types.BIT:
 			case java.sql.Types.TINYINT:
 			case java.sql.Types.SMALLINT:
-				drdaType = FdocaConstants.DRDA_TYPE_NSMALL;
+				drdaType = DRDAConstants.DRDA_TYPE_NSMALL;
 				outlen[0] = 2;
 				break;
 			case java.sql.Types.INTEGER:
-				drdaType = FdocaConstants.DRDA_TYPE_NINTEGER;
+				drdaType = DRDAConstants.DRDA_TYPE_NINTEGER;
 				outlen[0] = 4;
 				break;
 			case java.sql.Types.BIGINT:
-				drdaType = FdocaConstants.DRDA_TYPE_NINTEGER8;
+				drdaType = DRDAConstants.DRDA_TYPE_NINTEGER8;
 				outlen[0] = 8;
 				break;
 			case java.sql.Types.REAL:
-				drdaType = FdocaConstants.DRDA_TYPE_NFLOAT4;
+				drdaType = DRDAConstants.DRDA_TYPE_NFLOAT4;
 				outlen[0] = 4;
 				break;
 			case java.sql.Types.DOUBLE:
 			case java.sql.Types.FLOAT:
-				drdaType = FdocaConstants.DRDA_TYPE_NFLOAT8;
+				drdaType = DRDAConstants.DRDA_TYPE_NFLOAT8;
 				outlen[0] = 8;
 				break;
 			case java.sql.Types.NUMERIC:
 			case java.sql.Types.DECIMAL:
-				drdaType = FdocaConstants.DRDA_TYPE_NDECIMAL;
+				drdaType = DRDAConstants.DRDA_TYPE_NDECIMAL;
 				//needs to be adjusted for actual value
 				outlen[0] = -1;
 				break;
 			case java.sql.Types.DATE:
-				drdaType = FdocaConstants.DRDA_TYPE_NDATE;
+				drdaType = DRDAConstants.DRDA_TYPE_NDATE;
 				outlen[0] = 10;
 				break;
 			case java.sql.Types.TIME:
-				drdaType = FdocaConstants.DRDA_TYPE_NTIME;
+				drdaType = DRDAConstants.DRDA_TYPE_NTIME;
 				outlen[0] = 8;
 				break;
 			case java.sql.Types.TIMESTAMP:
-				drdaType = FdocaConstants.DRDA_TYPE_NTIMESTAMP;
+				drdaType = DRDAConstants.DRDA_TYPE_NTIMESTAMP;
 				outlen[0] = 26;
 				break;
 			case java.sql.Types.CHAR:
-//				drdaType = FdocaConstants.DRDA_TYPE_NCHAR;
+//				drdaType = DRDAConstants.DRDA_TYPE_NCHAR;
 				//making this NVARMIX for now to handle different byte length
 				//characters - checking with Paul to see if this is the
 				//correct way to handle it.
-				drdaType = FdocaConstants.DRDA_TYPE_NVARMIX;
+				drdaType = DRDAConstants.DRDA_TYPE_NVARMIX;
 				outlen[0] = -1;
 				break;
 			case java.sql.Types.VARCHAR:
-				drdaType = FdocaConstants.DRDA_TYPE_NVARCHAR;
+				drdaType = DRDAConstants.DRDA_TYPE_NVARCHAR;
 				outlen[0] = -1;
 				break;
 				// we will just convert a java object to a string
 				// since jcc doesn't support it.
 			case java.sql.Types.JAVA_OBJECT:
-				drdaType = FdocaConstants.DRDA_TYPE_NLONG;
+				drdaType = DRDAConstants.DRDA_TYPE_NLONG;
 				outlen[0] = LONGVARCHAR_MAX_LEN;
 				break;
 			case java.sql.Types.LONGVARCHAR:
-					drdaType = DRDA_TYPE_NLONG;
+					drdaType = DRDAConstants.DRDA_TYPE_NLONG;
 					outlen[0] = LONGVARCHAR_MAX_LEN;
 				break;
 			case java.sql.Types.BINARY:
 			case java.sql.Types.VARBINARY:
-				drdaType = FdocaConstants.DRDA_TYPE_NVARBYTE;
+				drdaType = DRDAConstants.DRDA_TYPE_NVARBYTE;
 				outlen[0] = -1;
 				break;
 			case java.sql.Types.LONGVARBINARY:
-					drdaType = FdocaConstants.DRDA_TYPE_NLONGVARBYTE;
+					drdaType = DRDAConstants.DRDA_TYPE_NLONGVARBYTE;
 					outlen[0] = LONGVARBINARY_MAX_LEN;
 				break;
 				// blob begin
 				// merge BLOB and BLOB_LOCATOR ????
 			case java.sql.Types.BLOB:
-				drdaType = FdocaConstants.DRDA_TYPE_NLOBBYTES;
+				drdaType = DRDAConstants.DRDA_TYPE_NLOBBYTES;
 				// indicates fdocadata is a place holder with 4 byte length
 				outlen[0] = 0x8004;
 				break;
 			case java.sql.Types.CLOB:
-				drdaType = FdocaConstants.DRDA_TYPE_NLOBCMIXED;
+				drdaType = DRDAConstants.DRDA_TYPE_NLOBCMIXED;
 				outlen[0] = 0x8004;
 				break;
 				// blob end
@@ -362,9 +242,24 @@
 		if (!nullable)
 			drdaType--;
 		return drdaType;
+	}
+
+	/***
+	 * Convert the jdbcType to one which we know how to exchange with
+	 * the client. This depends on the version of the client.
+	 **/
+	protected	static	int	clipJdbcType( AppRequester appRequester, int original )
+	{
+		switch ( original )
+		{
+			case JDBC30Translation.BOOLEAN:
 
+				if ( appRequester.supportsBoolean() ) { return original; }
+				else { return java.sql.Types.BIT; }
 
-	}
+		    default:	return original;
+		}
 
+	}
 
 }

Modified: db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java?rev=358163&r1=358162&r2=358163&view=diff
==============================================================================
--- db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java (original)
+++ db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/NetworkServerControlImpl.java Tue Dec 20 16:53:42 2005
@@ -50,6 +50,7 @@
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.derby.iapi.jdbc.DRDAServerStarter;
 import org.apache.derby.iapi.reference.Attribute;
+import org.apache.derby.iapi.reference.DRDAConstants;
 import org.apache.derby.iapi.reference.Property;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.services.i18n.MessageService;
@@ -332,7 +333,7 @@
 		// mm = minor version
 		// x = drda MaintenanceVersion
 
-		prdId = "CSS";
+		prdId = DRDAConstants.DERBY_DRDA_SERVER_ID;
 		if (majorStr.length() == 1)
 			prdId += "0";
 		prdId += majorStr;



Mime
View raw message