db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rhille...@apache.org
Subject svn commit: r1043245 - in /db/derby/code/trunk/java: demo/vtis/java/org/apache/derbyDemo/vtis/core/ demo/vtis/java/org/apache/derbyDemo/vtis/example/ engine/org/apache/derby/vti/
Date Wed, 08 Dec 2010 00:44:50 GMT
Author: rhillegas
Date: Wed Dec  8 00:44:49 2010
New Revision: 1043245

URL: http://svn.apache.org/viewvc?rev=1043245&view=rev
Log:
DERBY-4932: Remove the version of StringColumnVTI in the demo subtree.

Removed:
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/StringColumnVTI.java
Modified:
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java
    db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java
    db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java

Modified: db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java?rev=1043245&r1=1043244&r2=1043245&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java
(original)
+++ db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/FlatFileVTI.java
Wed Dec  8 00:44:49 2010
@@ -27,6 +27,8 @@ import java.sql.*;
 import java.text.DateFormat;
 import java.text.ParseException;
 
+import org.apache.derby.vti.StringColumnVTI;
+
 /**
  * <p>
  * This VTI makes a table out of the records in a flat file. This is an abstract

Modified: db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java?rev=1043245&r1=1043244&r2=1043245&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java (original)
+++ db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/core/XmlVTI.java Wed
Dec  8 00:44:49 2010
@@ -30,6 +30,8 @@ import java.text.ParseException;
 import javax.xml.parsers.*;
 import org.w3c.dom.*;
 
+import org.apache.derby.vti.StringColumnVTI;
+    
 /**
  * <p>
  * This is a VTI designed to read XML files which are structured like row sets.
@@ -306,15 +308,14 @@ public  class   XmlVTI  extends StringCo
      private    void    parseRow( int rowNumber ) throws Exception
     {
         Element         rawRow = (Element) _rawRows.item( rowNumber );
-       String[]        columnNames = getColumnNames();
-        int                 columnCount = columnNames.length;
+        int                 columnCount = getColumnCount();
         
         _currentRow = new String[ columnCount ];
 
         for ( int i = 0; i < columnCount; i++ )
         {
             // first look for an attribute by the column name
-            String      columnName = columnNames[ i ];
+            String      columnName = getColumnName( i + 1 );
             String      contents = rawRow.getAttribute( columnName );
 
             // if there is not attribute by that name, then look for descendent elements
by

Modified: db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java?rev=1043245&r1=1043244&r2=1043245&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java
(original)
+++ db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/ApacheServerLogVTI.java
Wed Dec  8 00:44:49 2010
@@ -68,7 +68,7 @@ public  class   ApacheServerLogVTI  exte
     
     ///////////////////////////////////////////////////////////////////////////////////
     //
-    // ResultSet BEHAVIOR
+    // OVERRIDES
     //
     ///////////////////////////////////////////////////////////////////////////////////
 
@@ -77,15 +77,11 @@ public  class   ApacheServerLogVTI  exte
      * The Apache Server's logs represent nulls as "-".
      * </p>
      */
-    public String getString(int columnIndex) throws SQLException
+    public String getRawColumn(int columnIndex) throws SQLException
     {
-        String  columnValue = super.getString( columnIndex );
+        String  columnValue = super.getRawColumn( columnIndex );
 
-        if ( "-".equals( columnValue ) )
-        {
-            setWasNull();
-            return null;
-        }
+        if ( "-".equals( columnValue ) ) { return null; }
         else { return columnValue; }
     }
 

Modified: db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java?rev=1043245&r1=1043244&r2=1043245&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java
(original)
+++ db/derby/code/trunk/java/demo/vtis/java/org/apache/derbyDemo/vtis/example/DerbyJiraReportVTI.java
Wed Dec  8 00:44:49 2010
@@ -81,7 +81,7 @@ public  class   DerbyJiraReportVTI  exte
     {
         String  rawValue = super.getString( columnIndex );
 
-        if ( !"key".equals( getColumnNames()[ columnIndex - 1 ] ) )
+        if ( !"key".equals( getColumnName( columnIndex ) ) )
         { return rawValue; }
         else
         { return rawValue.substring( 6 ); }

Modified: 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=1043245&r1=1043244&r2=1043245&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/vti/StringColumnVTI.java Wed Dec  8 00:44:49
2010
@@ -106,6 +106,26 @@ public  abstract    class   StringColumn
     
     ///////////////////////////////////////////////////////////////////////////////////
     //
+    // ACCESSORS
+    //
+    ///////////////////////////////////////////////////////////////////////////////////
+
+    /**
+     * <p>
+     * Get the number of columns.
+     * </p>
+     */
+    public int getColumnCount() { return _columnNames.length; }
+
+    /**
+     * <p>
+     * Get name of a column (1-based indexing).
+     * </p>
+     */
+    public String getColumnName( int columnNumber ) { return _columnNames[ columnNumber -
1 ]; }
+
+    ///////////////////////////////////////////////////////////////////////////////////
+    //
     // ResultSet BEHAVIOR
     //
     ///////////////////////////////////////////////////////////////////////////////////



Mime
View raw message