db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1043122 - in /db/derby/code/trunk: java/engine/org/apache/derby/iapi/types/ java/engine/org/apache/derby/vti/ java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ java/testing/org/apache/derbyTesting/functionTests/tests/lang/ ...
Date Tue, 07 Dec 2010 16:43:08 GMT
Author: rhillegas
Date: Tue Dec  7 16:43:07 2010
New Revision: 1043122

URL: http://svn.apache.org/viewvc?rev=1043122&view=rev
Log:
DERBY-4932: Move StringColumnVTI out of its testing package into the public api.

Added:
    db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java   (with props)
Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialClob.java
    db/derby/code/trunk/java/engine/org/apache/derby/vti/build.xml
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringArrayVTI.java
    db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringColumnVTI.java
    db/derby/code/trunk/tools/jar/extraDBMSclasses.properties
    db/derby/code/trunk/tools/javadoc/publishedapi.ant

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialBlob.java Tue Dec  7 16:43:07 2010
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.iapi.types.SQLClob
+   Derby - Class org.apache.derby.iapi.types.HarmonySerialBlob
 
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialClob.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialClob.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialClob.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/types/HarmonySerialClob.java Tue Dec  7 16:43:07 2010
@@ -1,6 +1,6 @@
 /*
 
-   Derby - Class org.apache.derby.iapi.types.SQLClob
+   Derby - Class org.apache.derby.iapi.types.HarmonySerialClob
 
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
@@ -53,6 +53,8 @@ public class HarmonySerialClob implement
     // required by serialized form
     private long origLen;
 
+    public HarmonySerialClob( String raw ) { this( raw.toCharArray() ); }
+
     public HarmonySerialClob(char[] ch) {
         buf = new char[ch.length];
         origLen = ch.length;

Added: db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java?rev=1043122&view=auto
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java (added)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java Tue Dec  7 16:43:07 2010
@@ -0,0 +1,378 @@
+/*
+
+Derby - Class org.apache.derby.vti.StringColumnVTI
+
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+
+*/
+
+package org.apache.derby.vti;
+
+import java.io.ByteArrayInputStream;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.math.BigDecimal;
+import java.sql.Blob;
+import java.sql.Clob;
+import java.sql.Date;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.sql.Time;
+import java.sql.Timestamp;
+import java.text.DateFormat;
+import java.text.ParseException;
+
+import org.apache.derby.iapi.types.HarmonySerialBlob;
+import org.apache.derby.iapi.types.HarmonySerialClob;
+
+/**
+ * <p>
+ * This is an abstract table function which assumes that all columns are strings and which
+ * coerces the strings to reasonable values for various getXXX()
+ * methods. Subclasses must implement the following ResultSet methods:
+ * </p>
+ *
+ * <ul>
+ * <li>next( )</li>
+ * <li>close()</li>
+ * </ul>
+ *
+ * <p>
+ * and the following protected method introduced by this class:
+ * </p>
+ *
+ * <ul>
+ * <li>getRawColumn( int columnNumber )</li>
+ * </ul>
+ */
+public  abstract    class   StringColumnVTI extends VTITemplate
+{
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // CONSTANTS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // STATE
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    private String[]      _columnNames;
+    private boolean _lastColumnWasNull;
+    
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // StringColumnVTI BEHAVIOR TO BE IMPLEMENTED BY SUBCLASSES
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Get the string value of the column in the current row identified by the 1-based columnNumber.
+     * </p>
+     */
+    protected  abstract    String  getRawColumn( int columnNumber ) throws SQLException;
+    
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // CONSTRUCTORS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Build a StringColumnVTI with the given column names
+     * </p>
+     */
+    public  StringColumnVTI( String[] columnNames )
+    {
+        _columnNames = columnNames;
+    }
+    
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // ResultSet BEHAVIOR
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /** This method returns null. Derby does not look at the metadata returned by the table function. */
+    public ResultSetMetaData getMetaData() throws SQLException { return null; }
+    
+    public boolean wasNull() throws SQLException { return _lastColumnWasNull; }
+    
+    public int findColumn( String columnName ) throws SQLException
+    {
+        int     count = _columnNames.length;
+
+        for ( int i = 0; i < count; i++ ) { if ( _columnNames[ i ].equals( columnName ) ) { return i+1; } }
+
+        throw new SQLException( "Unknown column name." );
+    }
+    
+    public String getString(int columnIndex) throws SQLException
+    {
+        String  columnValue = getRawColumn( columnIndex );
+
+        checkNull( columnValue );
+
+        return columnValue;
+    }
+    
+    public boolean getBoolean(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return false; }
+        else { return Boolean.valueOf( columnValue ).booleanValue(); }
+    }
+
+    public byte getByte(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return (byte) 0; }
+        else
+        {
+            try {
+                return Byte.valueOf( columnValue ).byteValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public short getShort(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return (short) 0; }
+        else
+        {
+            try {
+                return Short.valueOf( columnValue ).shortValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public int getInt(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return 0; }
+        else
+        {
+            try {
+                return Integer.valueOf( columnValue ).intValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public long getLong(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return (long) 0; }
+        else
+        {
+            try {
+                return Long.valueOf( columnValue ).longValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+   public float getFloat(int columnIndex) throws SQLException
+   {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return (float) 0; }
+        else
+        {
+            try {
+                return Float.valueOf( columnValue ).floatValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public double getDouble(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return (double) 0; }
+        else
+        {
+            try {
+                return Double.valueOf( columnValue ).doubleValue();
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public BigDecimal getBigDecimal(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            try {
+                return new BigDecimal( columnValue );
+            } catch (NumberFormatException e) { throw wrap( e ); }
+        }
+    }
+
+    public byte[] getBytes(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            try {
+                return columnValue.getBytes( "UTF-8" );
+            } catch (Throwable t) { throw new SQLException( t.getMessage() ); }
+        }
+    }
+
+    public java.sql.Date getDate(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            return new Date( parseDateTime( columnValue ) );
+        }
+    }
+
+    public java.sql.Time getTime(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            return new Time( parseDateTime( columnValue ) );
+        }
+    }
+
+    public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            return new Timestamp( parseDateTime( columnValue ) );
+        }
+    }
+
+    public InputStream getAsciiStream(int columnIndex) throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        return getEncodedStream( columnValue, "US-ASCII" );
+    }
+
+    public java.io.InputStream getBinaryStream(int columnIndex)
+        throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else { return new ByteArrayInputStream( getBytes( columnIndex ) ); }
+    }
+
+    public Blob getBlob(int columnIndex)
+        throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        else { return new HarmonySerialBlob( getBytes( columnIndex ) ); }
+    }
+    
+    public Clob getClob(int columnIndex)
+        throws SQLException
+    {
+        String  columnValue = getString( columnIndex );
+
+        if ( columnValue == null ) { return null; }
+        { return new HarmonySerialClob( getString( columnIndex ) ); }
+    }
+    
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
+    // MINIONS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Set the wasNull flag based on whether this column value turned out to be null.
+     * </p>
+     */
+    private void checkNull( String columnValue )
+    {
+        _lastColumnWasNull = ( columnValue == null );
+    }
+    
+    /**
+     * <p>
+     * Wrap an exception in a SQLException.
+     * </p>
+     */
+    private SQLException wrap( Throwable t )
+    {
+        return new SQLException( t.getMessage() );
+    }
+    
+    /**
+     * <p>
+     * Translate a date/time expression into the corresponding long number of
+     * milliseconds.
+     * </p>
+     */
+    private long parseDateTime( String columnValue  )
+        throws SQLException
+    {
+        try {
+            DateFormat      df = DateFormat.getDateTimeInstance();
+                
+            java.util.Date  rawDate = df.parse( columnValue );
+
+            return rawDate.getTime();
+        } catch (ParseException e) { throw wrap( e ); }
+    }
+    
+    /**
+     * <p>
+     * Turn a string into an appropriately encoded ByteArrayInputStream.
+     * </p>
+     */
+    private InputStream getEncodedStream( String columnValue, String encoding  )
+        throws SQLException
+    {
+        if ( columnValue == null ) { return null; }
+        else
+        {
+            try {
+                byte[]      rawBytes = columnValue.getBytes( encoding );
+            
+                return new ByteArrayInputStream( rawBytes );
+            } catch (UnsupportedEncodingException e) { throw wrap( e ); }
+        }
+    }
+
+}

Propchange: db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: db/derby/code/trunk/java/engine/org/apache/derby/vti/build.xml
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/vti/build.xml?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/build.xml (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/build.xml Tue Dec  7 16:43:07 2010
@@ -55,6 +55,7 @@
       </classpath>
       <include name="${derby.dir}/vti/*.java"/>
       <exclude name="${derby.dir}/vti/*Template.java"/>
+      <exclude name="${derby.dir}/vti/StringColumnVTI.java"/>
 
     </javac>
     <javac
@@ -74,6 +75,7 @@
         <pathelement path="${java14compile.classpath}"/>
       </classpath>
     	<include name="${derby.dir}/vti/*Template.java"/>
+    	<include name="${derby.dir}/vti/StringColumnVTI.java"/>
     </javac>
   </target>
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/ParameterMappingTest.java Tue Dec  7 16:43:07 2010
@@ -47,7 +47,9 @@ import org.apache.derbyTesting.junit.Bas
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.TestConfiguration;
 import org.apache.derbyTesting.junit.Utilities;
-import org.apache.derbyTesting.functionTests.tests.lang.StringColumnVTI;
+
+import org.apache.derby.iapi.types.HarmonySerialBlob;
+import org.apache.derby.iapi.types.HarmonySerialClob;
 
 /**
  * 
@@ -657,7 +659,7 @@ public class ParameterMappingTest extend
         cs.close();
 
         cs = chattyPrepareCall( conn, "call clobIn( ?, ? )" );
-        cs.setClob( 1, new StringColumnVTI.SimpleClob( "ghi" ) );
+        cs.setClob( 1, new HarmonySerialClob( "ghi" ) );
         cs.registerOutParameter( 2, Types.VARCHAR );
         cs.execute();
         assertEquals( "ghi", cs.getString( 2 ) );
@@ -703,7 +705,7 @@ public class ParameterMappingTest extend
         ps.close();
         
         cs = chattyPrepareCall( conn, "call clobInOut( ? )" );
-        cs.setClob( 1, new StringColumnVTI.SimpleClob( "ghi" ) );
+        cs.setClob( 1, new HarmonySerialClob( "ghi" ) );
         cs.registerOutParameter( 1, Types.CLOB );
         cs.execute();
         outVal = cs.getClob( 1 );
@@ -733,7 +735,7 @@ public class ParameterMappingTest extend
                           
         }
         
-        return new StringColumnVTI.SimpleClob( new String( value ) );
+        return new HarmonySerialClob( new String( value ) );
     }
     private void compareClobs( Clob left, Clob right ) throws Exception
     {
@@ -795,7 +797,7 @@ public class ParameterMappingTest extend
         ps.close();
 
         cs = chattyPrepareCall( conn, "call blobIn( ?, ? )" );
-        cs.setBlob( 1, new StringColumnVTI.SimpleBlob( "ghi".getBytes( UTF8 ) ) );
+        cs.setBlob( 1, new HarmonySerialBlob( "ghi".getBytes( UTF8 ) ) );
         cs.registerOutParameter( 2, Types.VARCHAR );
         cs.execute();
         assertEquals( "ghi", cs.getString( 2 ) );
@@ -841,7 +843,7 @@ public class ParameterMappingTest extend
         ps.close();
 
         cs = chattyPrepareCall( conn, "call blobInOut( ? )" );
-        cs.setBlob( 1, new StringColumnVTI.SimpleBlob( "ghi".getBytes( UTF8 ) ) );
+        cs.setBlob( 1, new HarmonySerialBlob( "ghi".getBytes( UTF8 ) ) );
         cs.registerOutParameter( 1, Types.BLOB );
         cs.execute();
         outVal = cs.getBlob( 1 );
@@ -871,7 +873,7 @@ public class ParameterMappingTest extend
                           
         }
         
-        return new StringColumnVTI.SimpleBlob( value );
+        return new HarmonySerialBlob( value );
     }
     private void compareBlobs( Blob left, Blob right ) throws Exception
     {
@@ -4114,14 +4116,14 @@ public class ParameterMappingTest extend
         byte[] retval = new byte[ leftLength + rightLength ];
         System.arraycopy( left, 0, retval, 0, leftLength );
         System.arraycopy( right, 0, retval, leftLength, rightLength );
-        inout[0] = new StringColumnVTI.SimpleBlob( retval );
+        inout[0] = new HarmonySerialBlob( retval );
         
-        out[0] = new StringColumnVTI.SimpleBlob( new byte[] { (byte) 1, (byte) 2, (byte) 3 } );
+        out[0] = new HarmonySerialBlob( new byte[] { (byte) 1, (byte) 2, (byte) 3 } );
     }
 
     public static void pmap(Clob in, Clob[] inout, Clob[] out) throws SQLException {
-        inout[0] = new StringColumnVTI.SimpleClob( in.getSubString( 1L, (int) in.length() ) + inout[0].getSubString( 1L, (int) inout[0].length() ) );
-        out[0] = new StringColumnVTI.SimpleClob( "abc" );
+        inout[0] = new HarmonySerialClob( in.getSubString( 1L, (int) in.length() ) + inout[0].getSubString( 1L, (int) inout[0].length() ) );
+        out[0] = new HarmonySerialClob( "abc" );
     }
 
     //
@@ -4134,7 +4136,7 @@ public class ParameterMappingTest extend
     }
     public static void clobOut( Clob[] c ) throws SQLException
     {
-        c[ 0 ] = new StringColumnVTI.SimpleClob( "abc" );
+        c[ 0 ] = new HarmonySerialClob( "abc" );
     }
     public static void clobInOut( Clob[] c ) throws SQLException
     {
@@ -4143,7 +4145,7 @@ public class ParameterMappingTest extend
         char[] inValue = value.toCharArray();
         char[] outValue = reverse( inValue );
 
-        c[ 0 ] = new StringColumnVTI.SimpleClob( new String( outValue ) );
+        c[ 0 ] = new HarmonySerialClob( new String( outValue ) );
     }
 
     private static String getClobValue( Clob c ) throws SQLException
@@ -4170,7 +4172,7 @@ public class ParameterMappingTest extend
     }
     public static void blobOut( Blob[] c ) throws Exception
     {
-        c[ 0 ] = new StringColumnVTI.SimpleBlob( "abc".getBytes( UTF8 ) );
+        c[ 0 ] = new HarmonySerialBlob( "abc".getBytes( UTF8 ) );
     }
     public static void blobInOut( Blob[] c ) throws Exception
     {
@@ -4179,7 +4181,7 @@ public class ParameterMappingTest extend
         char[] inValue = value.toCharArray();
         char[] outValue = reverse( inValue );
 
-        c[ 0 ] = new StringColumnVTI.SimpleBlob( (new String( outValue )).getBytes( UTF8 ) );
+        c[ 0 ] = new HarmonySerialBlob( (new String( outValue )).getBytes( UTF8 ) );
     }
 
     private static String getBlobValue( Blob c ) throws Exception

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/AnsiSignatures.java Tue Dec  7 16:43:07 2010
@@ -25,9 +25,13 @@ import java.math.BigDecimal;
 import java.sql.Blob;
 import java.sql.Clob;
 import java.sql.Date;
+import java.sql.SQLException;
 import java.sql.Time;
 import java.sql.Timestamp;
 
+import org.apache.derby.iapi.types.HarmonySerialBlob;
+import org.apache.derby.iapi.types.HarmonySerialClob;
+
 /**
  * <p>
  * These are methods for testing ANSI routine resolution. The resolution rules
@@ -1281,26 +1285,26 @@ public  class   AnsiSignatures
     
     // legal resolutions
 
-    public  static  Clob  clob_Clob_String( String a ) { return new StringColumnVTI.SimpleClob( a ); }
-    public  static  Clob  clob_Clob_String( boolean a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( byte a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( int a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( long a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( float a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( double a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Boolean a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Byte a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Short a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Long a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Float a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Double a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( BigDecimal a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Date a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Time a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Timestamp a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Clob a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Blob a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
-    public  static  Clob  clob_Clob_String( Object a ) { return new StringColumnVTI.SimpleClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( String a ) { return new HarmonySerialClob( a ); }
+    public  static  Clob  clob_Clob_String( boolean a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( byte a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( int a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( long a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( float a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( double a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Boolean a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Byte a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Short a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Long a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Float a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Double a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( BigDecimal a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Date a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Time a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Timestamp a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Clob a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Blob a ) { return new HarmonySerialClob( "-1" ); }
+    public  static  Clob  clob_Clob_String( Object a ) { return new HarmonySerialClob( "-1" ); }
 
     //
     // BLOB
@@ -1308,26 +1312,26 @@ public  class   AnsiSignatures
     
     // legal resolutions
 
-    public  static  Blob  blob_Blob_String( String a ) throws Exception { return new StringColumnVTI.SimpleBlob( a.getBytes( "UTF-8" ) ); }
-    public  static  Blob  blob_Blob_String( boolean a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( byte a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( int a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( long a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( float a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( double a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Boolean a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Byte a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Short a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Long a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Float a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Double a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( BigDecimal a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Date a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Time a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Timestamp a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Clob a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Blob a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
-    public  static  Blob  blob_Blob_String( Object a ) { return new StringColumnVTI.SimpleBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( String a ) throws Exception { return new HarmonySerialBlob( a.getBytes( "UTF-8" ) ); }
+    public  static  Blob  blob_Blob_String( boolean a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( byte a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( int a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( long a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( float a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( double a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Boolean a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Byte a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Short a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Long a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Float a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Double a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( BigDecimal a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Date a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Time a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Timestamp a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Clob a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Blob a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
+    public  static  Blob  blob_Blob_String( Object a ) throws SQLException { return new HarmonySerialBlob( new byte[] { (byte) -1 } ); }
 
     //
     // BLOB arguments

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/BooleanValuesTest.java Tue Dec  7 16:43:07 2010
@@ -36,6 +36,8 @@ import org.apache.derbyTesting.junit.Tes
 import org.apache.derbyTesting.junit.JDBC;
 import org.apache.derbyTesting.junit.XML;
 
+import org.apache.derby.iapi.types.HarmonySerialBlob;
+
 /**
  * <p>
  * Test Derby's expanding support for BOOLEAN values.
@@ -1661,9 +1663,9 @@ public class BooleanValuesTest  extends 
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
-    public static Blob makeSimpleBlob()
+    public static Blob makeSimpleBlob() throws SQLException
     {
-        return new StringColumnVTI.SimpleBlob( new byte[] { 1 } );
+        return new HarmonySerialBlob( new byte[] { 1 } );
     }
     
     public static String booleanValue( Boolean b )

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringArrayVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringArrayVTI.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringArrayVTI.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringArrayVTI.java Tue Dec  7 16:43:07 2010
@@ -24,6 +24,7 @@ package org.apache.derbyTesting.function
 import  java.sql.*;
 import java.util.Arrays;
 
+import org.apache.derby.vti.StringColumnVTI;
 import org.apache.derby.vti.VTICosting;
 import org.apache.derby.vti.VTIEnvironment;
 

Modified: db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringColumnVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringColumnVTI.java?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringColumnVTI.java (original)
+++ db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/lang/StringColumnVTI.java Tue Dec  7 16:43:07 2010
@@ -1,551 +0,0 @@
-/*
-
-Derby - Class org.apache.derbyTesting.functionTests.tests.lang.StringColumnVTI
-
-Licensed to the Apache Software Foundation (ASF) under one or more
-contributor license agreements.  See the NOTICE file distributed with
-this work for additional information regarding copyright ownership.
-The ASF licenses this file to You under the Apache License, Version 2.0
-(the "License"); you may not use this file except in compliance with
-the License.  You may obtain a copy of the License at
-
-http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
-
-*/
-
-package org.apache.derbyTesting.functionTests.tests.lang;
-
-import java.io.*;
-import java.math.BigDecimal;
-import java.sql.*;
-import java.text.DateFormat;
-import java.text.ParseException;
-
-import org.apache.derby.vti.VTITemplate;
-
-/**
- * <p>
- * This is an abstract VTI which assumes that all columns are strings and which
- * coerces the strings to reasonable values for various getXXX()
- * methods. Subclasses must implement the following ResultSet methods:
- * </p>
- *
- * <ul>
- * <li>next( )</li>
- * <li>close()</li>
- * <li>getMetaData()</li>
- * </ul>
- *
- * <p>
- * and the following protected methods introduced by this class:
- * </p>
- *
- * <ul>
- * <li>getRawColumn( int columnNumber )</li>
- * </ul>
- */
-public  abstract    class   StringColumnVTI extends VTITemplate
-{
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // CONSTANTS
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // INNER CLASSES
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    /**
-     * <p>
-     * A crude Blob implementation for datatype testing.
-     * </p>
-     */
-    public	static	final	class	SimpleBlob	implements	Blob
-    {
-        private	byte[]	_bytes;
-        
-        public	SimpleBlob( byte[] bytes )
-        {
-            _bytes = bytes;
-        }
-        
-        public	InputStream	getBinaryStream()
-        {
-            return new ByteArrayInputStream( _bytes );
-        }
-        
-        public	byte[]	getBytes( long position, int length )
-        {
-            byte[]  result = new byte[ length ];
-            System.arraycopy( _bytes, ((int) position) - 1, result, 0, length );
-            
-            return result;
-        }
-        
-        public	long	length()
-        {
-            if ( _bytes == null ) { return 0L; }
-            return (long) _bytes.length;
-        }
-        
-        public	long	position( Blob pattern, long start ) { return 0L; }
-        public	long	position( byte[] pattern, long start ) { return 0L; }
-        
-        public	boolean	equals( Object other )
-        {
-            if ( other == null ) { return false; }
-            if ( !( other instanceof Blob ) ) { return false; }
-            
-            Blob	that = (Blob) other;
-            
-            try {
-                if ( this.length() != that.length() ) { return false; }
-                
-                InputStream	thisStream = this.getBinaryStream();
-                InputStream	thatStream = that.getBinaryStream();
-                
-                while( true )
-                {
-                    int		nextByte = thisStream.read();
-                    
-                    if ( nextByte < 0 ) { break; }
-                    if ( nextByte != thatStream.read() ) { return false; }
-                }
-            }
-            catch (Exception e)
-            {
-                System.err.println( e.getMessage() );
-                e.printStackTrace();
-                return false;
-            }
-            
-            return true;
-        }
-        
-        public int setBytes(long arg0, byte[] arg1) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-        
-        public int setBytes(long arg0, byte[] arg1, int arg2, int arg3) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-
-        public OutputStream setBinaryStream(long arg0) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-
-        public void truncate(long arg0) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-    }
-    
-    /**
-     * <p>
-     * A crude Clob implementation.
-     * </p>
-     */
-    public	static	final	class	SimpleClob	implements	Clob
-    {
-        private	String	_contents;
-
-        public	SimpleClob( String contents )
-        {
-            _contents = contents;
-        }
-        
-        public	InputStream	getAsciiStream()
-        {
-            try {
-                return new ByteArrayInputStream( _contents.getBytes( "UTF-8" ) );
-            }
-            catch (Exception e) { return null; }
-        }
-        
-        public	Reader	getCharacterStream()
-        {
-            return new CharArrayReader( _contents.toCharArray() );
-        }
-        
-        public	String	getSubString( long position, int length )
-        {
-            return _contents.substring( ((int) position) - 1, length );
-        }
-		
-        public	long	length()
-        {
-            if ( _contents == null ) { return 0L; }
-            return (long) _contents.length();
-        }
-        
-        public	long	position( Clob searchstr, long start ) { return 0L; }
-        public	long	position( String searchstr, long start ) { return 0L; }
-        
-        public	boolean	equals( Object other )
-        {
-            if ( other == null ) { return false; }
-            if ( !( other instanceof Clob ) ) { return false; }
-            
-            Clob	that = (Clob) other;
-            
-            try {
-                if ( this.length() != that.length() ) { return false; }
-                
-                InputStream	thisStream = this.getAsciiStream();
-                InputStream	thatStream = that.getAsciiStream();
-                
-                while( true )
-                {
-                    int		nextByte = thisStream.read();
-                    
-                    if ( nextByte < 0 ) { break; }
-                    if ( nextByte != thatStream.read() ) { return false; }
-                }
-            }
-            catch (Exception e)
-            {
-                System.err.println( e.getMessage() );
-                e.printStackTrace();
-                return false;
-            }
-            
-            return true;
-        }
-        
-        public int setString(long arg0, String arg1) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-        
-        public int setString(long arg0, String arg1, int arg2, int arg3) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-
-        public OutputStream setAsciiStream(long arg0) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-
-        public Writer setCharacterStream(long arg0) throws SQLException {
-            throw new SQLException("not implemented");
-        }
-
-        public void truncate(long arg0) throws SQLException {
-            throw new SQLException("not implemented");    
-        }
-
-    }
-    
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // STATE
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    private String[]      _columnNames;
-    private boolean _lastColumnWasNull;
-    
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // StringColumnVTI BEHAVIOR TO BE IMPLEMENTED BY SUBCLASSES
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    /**
-     * <p>
-     * Get the string value of the column in the current row identified by the 1-based columnNumber.
-     * </p>
-     */
-    protected  abstract    String  getRawColumn( int columnNumber ) throws SQLException;
-    
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // CONSTRUCTORS
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    /**
-     * <p>
-     * Build a StringColumnVTI with the given column names
-     * </p>
-     */
-    public  StringColumnVTI( String[] columnNames )
-    {
-        _columnNames = columnNames;
-    }
-    
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // ResultSet BEHAVIOR
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    public boolean wasNull() throws SQLException { return _lastColumnWasNull; }
-    
-    public int findColumn( String columnName ) throws SQLException
-    {
-        int     count = _columnNames.length;
-
-        for ( int i = 0; i < count; i++ ) { if ( _columnNames[ i ].equals( columnName ) ) { return i+1; } }
-
-        throw new SQLException( "Unknown column name." );
-    }
-    
-    public String getString(int columnIndex) throws SQLException
-    {
-        String  columnValue = getRawColumn( columnIndex );
-
-        checkNull( columnValue );
-
-        return columnValue;
-    }
-    
-    public boolean getBoolean(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return false; }
-        else { return Boolean.valueOf( columnValue ).booleanValue(); }
-    }
-
-    public byte getByte(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return (byte) 0; }
-        else
-        {
-            try {
-                return Byte.valueOf( columnValue ).byteValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public short getShort(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return (short) 0; }
-        else
-        {
-            try {
-                return Short.valueOf( columnValue ).shortValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public int getInt(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return 0; }
-        else
-        {
-            try {
-                return Integer.valueOf( columnValue ).intValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public long getLong(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return (long) 0; }
-        else
-        {
-            try {
-                return Long.valueOf( columnValue ).longValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-   public float getFloat(int columnIndex) throws SQLException
-   {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return (float) 0; }
-        else
-        {
-            try {
-                return Float.valueOf( columnValue ).floatValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public double getDouble(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return (double) 0; }
-        else
-        {
-            try {
-                return Double.valueOf( columnValue ).doubleValue();
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public BigDecimal getBigDecimal(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            try {
-                return new BigDecimal( columnValue );
-            } catch (NumberFormatException e) { throw wrap( e ); }
-        }
-    }
-
-    public byte[] getBytes(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            try {
-                return columnValue.getBytes( "UTF-8" );
-            } catch (Throwable t) { throw new SQLException( t.getMessage() ); }
-        }
-    }
-
-    public java.sql.Date getDate(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            return new Date( parseDateTime( columnValue ) );
-        }
-    }
-
-    public java.sql.Time getTime(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            return new Time( parseDateTime( columnValue ) );
-        }
-    }
-
-    public java.sql.Timestamp getTimestamp(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            return new Timestamp( parseDateTime( columnValue ) );
-        }
-    }
-
-    public InputStream getAsciiStream(int columnIndex) throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        return getEncodedStream( columnValue, "US-ASCII" );
-    }
-
-    public java.io.InputStream getBinaryStream(int columnIndex)
-        throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else { return new ByteArrayInputStream( getBytes( columnIndex ) ); }
-    }
-
-    public Blob getBlob(int columnIndex)
-        throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        else { return new SimpleBlob( getBytes( columnIndex ) ); }
-    }
-    
-    public Clob getClob(int columnIndex)
-        throws SQLException
-    {
-        String  columnValue = getString( columnIndex );
-
-        if ( columnValue == null ) { return null; }
-        { return new SimpleClob( getString( columnIndex ) ); }
-    }
-    
-    ///////////////////////////////////////////////////////////////////////////////////
-    //
-    // MINIONS
-    //
-    ///////////////////////////////////////////////////////////////////////////////////
-
-    /**
-     * <p>
-     * Set the wasNull flag based on whether this column value turned out to be null.
-     * </p>
-     */
-    private void checkNull( String columnValue )
-    {
-        _lastColumnWasNull = ( columnValue == null );
-    }
-    
-    /**
-     * <p>
-     * Wrap an exception in a SQLException.
-     * </p>
-     */
-    private SQLException wrap( Throwable t )
-    {
-        return new SQLException( t.getMessage() );
-    }
-    
-    /**
-     * <p>
-     * Translate a date/time expression into the corresponding long number of
-     * milliseconds.
-     * </p>
-     */
-    private long parseDateTime( String columnValue  )
-        throws SQLException
-    {
-        try {
-            DateFormat      df = DateFormat.getDateTimeInstance();
-                
-            java.util.Date  rawDate = df.parse( columnValue );
-
-            return rawDate.getTime();
-        } catch (ParseException e) { throw wrap( e ); }
-    }
-    
-    /**
-     * <p>
-     * Turn a string into an appropriately encoded ByteArrayInputStream.
-     * </p>
-     */
-    private InputStream getEncodedStream( String columnValue, String encoding  )
-        throws SQLException
-    {
-        if ( columnValue == null ) { return null; }
-        else
-        {
-            try {
-                byte[]      rawBytes = columnValue.getBytes( encoding );
-            
-                return new ByteArrayInputStream( rawBytes );
-            } catch (UnsupportedEncodingException e) { throw wrap( e ); }
-        }
-    }
-
-}

Modified: db/derby/code/trunk/tools/jar/extraDBMSclasses.properties
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/jar/extraDBMSclasses.properties?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/tools/jar/extraDBMSclasses.properties (original)
+++ db/derby/code/trunk/tools/jar/extraDBMSclasses.properties Tue Dec  7 16:43:07 2010
@@ -33,6 +33,7 @@ derby.module.jndi.LDAPSchemeImpl=org.apa
 derby.module.vti.locktable=org.apache.derby.diag.LockTable
 derby.module.vti.metadata.template=org.apache.derby.vti.VTIMetaDataTemplate
 derby.module.vti.template=org.apache.derby.vti.VTITemplate
+derby.module.vti.StringColumnVTI=org.apache.derby.vti.StringColumnVTI
 derby.module.vti.updatabletemplate=org.apache.derby.vti.UpdatableVTITemplate
 derby.module.vti.transactiontable=org.apache.derby.diag.TransactionTable
 derby.module.vti.triggerold=org.apache.derby.catalog.TriggerOldTransitionRows

Modified: db/derby/code/trunk/tools/javadoc/publishedapi.ant
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/tools/javadoc/publishedapi.ant?rev=1043122&r1=1043121&r2=1043122&view=diff
==============================================================================
--- db/derby/code/trunk/tools/javadoc/publishedapi.ant (original)
+++ db/derby/code/trunk/tools/javadoc/publishedapi.ant Tue Dec  7 16:43:07 2010
@@ -52,6 +52,7 @@ org/apache/derby/tools/dblook.java
 
 org/apache/derby/vti/RestrictedVTI.java
 org/apache/derby/vti/Restriction.java
+org/apache/derby/vti/StringColumnVTI.java
 org/apache/derby/vti/VTICosting.java
 org/apache/derby/vti/VTIEnvironment.java
 org/apache/derby/vti/VTITemplate.java



Mime
View raw message