harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ton...@apache.org
Subject svn commit: r596555 - in /harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset: CachedRow.java CachedRowSetImpl.java CachedRowSetWriter.java
Date Tue, 20 Nov 2007 07:18:56 GMT
Author: tonywu
Date: Mon Nov 19 23:18:55 2007
New Revision: 596555

URL: http://svn.apache.org/viewvc?rev=596555&view=rev
Log:
Apply patch HARMONY-5151 ([classlib][sql] refactor CachedRow, rename boolean variable insert
to isInsert)

Modified:
    harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
    harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
    harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java?rev=596555&r1=596554&r2=596555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRow.java
Mon Nov 19 23:18:55 2007
@@ -16,12 +16,10 @@
  */
 package org.apache.harmony.sql.internal.rowset;
 
-
-import java.sql.Blob;
 import java.sql.SQLException;
 import java.util.BitSet;
 
-public class CachedRow implements Cloneable{
+public class CachedRow implements Cloneable {
     private Object[] columnData;
 
     private Object[] originalColumnData;
@@ -30,13 +28,15 @@
 
     private boolean isDelete;
 
-    private boolean insert;
+    private boolean isInsert;
+
+    private boolean isUpdate;
 
     private boolean nonUpdateable = false;
 
     public CachedRow(Object[] columnData) {
-        this.columnData = columnData;
-        this.originalColumnData = columnData;
+        this.columnData = columnData.clone();
+        originalColumnData = columnData.clone();
         mask = new BitSet(columnData.length);
     }
 
@@ -47,12 +47,13 @@
     public void setUpdateMask(int i) {
         mask.set(i);
     }
-    
-    public void setUnavailable(){
+
+    public void setUnavailable() {
+        // FIXME: What is this method used for?
         setDelete();
         setInsert();
         mask.clear();
-        mask.flip(0,columnData.length);
+        mask.flip(0, columnData.length);
     }
 
     public void setNonUpdateable() {
@@ -68,71 +69,59 @@
     }
 
     public void setDelete() {
-        this.isDelete = true;
+        isDelete = true;
     }
-    
-    public void unDoDelete() {
-        this.isDelete = false;
+
+    public void undoDelete() {
+        isDelete = false;
     }
 
-    public boolean getDelete() {
+    public boolean isDelete() {
         return isDelete;
     }
 
     public void setInsert() {
-        this.insert = true;
+        isInsert = true;
     }
 
-    public boolean getInsert() {
-        return this.insert;
+    public boolean isInsert() {
+        return isInsert;
     }
 
-    public void updateString(int columnIndex, String x) throws SQLException {
-        if (nonUpdateable)
-            throw new SQLException("Not Updateable of the CurrentRow");
-        this.columnData[columnIndex - 1] = x;
-        setUpdateMask(columnIndex - 1);
+    public void setUpdate() {
+        isUpdate = true;
     }
 
-    public void updateInt(int columnIndex, int x) {
-        this.columnData[columnIndex - 1] = x;
-        setUpdateMask(columnIndex - 1);
-    }
-    
-    public CachedRow getOriginal() {
-        return new CachedRow(originalColumnData);
+    public void undoUpdate() {
+        isUpdate = false;
+        mask.flip(0, columnData.length);
+        columnData = originalColumnData.clone();
     }
 
-    public String getString(int columnIndex) {
-        return (String) this.columnData[columnIndex - 1];
-    }
-    
-    public Object getObject(int columnIndex) {
-        return this.columnData[columnIndex - 1];
-    }
-
-    public int getInt(int columnIndex) {
-        return (Integer) this.columnData[columnIndex - 1];
+    public boolean isUpdate() {
+        return isUpdate;
     }
 
-    public Blob getBLOb(int columnIndex) {
-        return (Blob) this.columnData[columnIndex - 1];
-    }
+    public void updateObject(int columnIndex, Object x) throws SQLException {
+        if (nonUpdateable) {
+            // TODO load message from resource file
+            throw new SQLException("Not Updateable of the CurrentRow");
+        }
 
-    public boolean getBoolean(int columnIndex) {
-        return (Boolean) this.columnData[columnIndex - 1];
+        columnData[columnIndex - 1] = x;
+        setUpdateMask(columnIndex - 1);
     }
 
-    public byte getByte(int columnIndex) {
-        return (Byte) this.columnData[columnIndex - 1];
+    public CachedRow getOriginal() {
+        return new CachedRow(originalColumnData);
     }
 
-    public byte[] getBytes(int columnIndex) {
-        return (byte[]) this.columnData[columnIndex - 1];
+    public Object getObject(int columnIndex) {
+        return columnData[columnIndex - 1];
     }
 
     // deep clone
-    public CachedRow createClone() throws CloneNotSupportedException {  
+    public CachedRow createClone() throws CloneNotSupportedException {
         CachedRow cr = (CachedRow) super.clone();
 
         Object[] cd = new Object[columnData.length];
@@ -140,8 +129,9 @@
             cd[i] = columnData[i];
         }
         cr.columnData = cd;
-        cr.insert = insert;
+        cr.isInsert = isInsert;
         cr.isDelete = isDelete;
+        cr.isUpdate = isUpdate;
         cr.mask = (BitSet) mask.clone();
         cr.nonUpdateable = nonUpdateable;
         // cr.originalColumnData

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java?rev=596555&r1=596554&r2=596555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetImpl.java
Mon Nov 19 23:18:55 2007
@@ -105,23 +105,29 @@
     }
 
     public void setRows(ArrayList<CachedRow> data, int cloumnCount) {
-        this.rows = data;
+        rows = data;
         this.columnCount = cloumnCount;
     }
 
     public void acceptChanges() throws SyncProviderException {
-        if (currentRow == insertRow)
+        if (currentRow == insertRow) {
             throw new SyncProviderException();
+        }
+
         try {
-            acceptChanges(this.getConnection());
+            acceptChanges(getConnection());
         } catch (SQLException e) {
+            // FIXME deal with the exception, not just print it
             e.printStackTrace();
         }
     }
 
     public void acceptChanges(Connection con) throws SyncProviderException {
-        if (currentRow == insertRow)
+        if (currentRow == insertRow) {
+            // TODO add error messages
             throw new SyncProviderException();
+        }
+
         try {
             setUrl(con.getMetaData().getURL());
             RowSetWriter rowSetWriter = syncProvider.getRowSetWriter();
@@ -130,6 +136,7 @@
             // setOriginalRow();
             notifyRowSetChanged();
         } catch (SQLException e) {
+            // TODO deal with the exception
             e.printStackTrace();
             throw new SyncProviderException();
         }
@@ -168,10 +175,12 @@
             // restore "this"'s states
             int temp = currentRowIndex;
             CachedRow cr;
-            if (currentRow != null)
+            if (currentRow != null) {
                 cr = currentRow.createClone();
-            else
+            } else {
                 cr = null;
+            }
+
             first();
 
             // Deep Copy
@@ -185,14 +194,14 @@
             // inspect!
             ((CachedRowSetImpl) output).setRows(data, columnCount);
             output.setMetaData(((RowSetMetaDataImpl) getMetaData()));
-            output.originalResultSet = this.originalResultSet;
+            output.originalResultSet = originalResultSet;
             output.setUrl(getUrl());
             output.setTableName(getTableName());
 
             // Constraints
             output.setReadOnly(isReadOnly());
-            output.setConcurrency(this.getConcurrency());
-            output.setType(this.getType());
+            output.setConcurrency(getConcurrency());
+            output.setType(getType());
 
             // recovery this's state for the modification of the operation
             // first() and next();
@@ -201,6 +210,7 @@
 
             return output;
         } catch (CloneNotSupportedException e) {
+            // FIXME deal with the exception
             e.printStackTrace();
             return null;
         }
@@ -213,10 +223,12 @@
             // restore "this"'s states
             int temp = currentRowIndex;
             CachedRow cr;
-            if (currentRow != null)
+            if (currentRow != null) {
                 cr = currentRow.createClone();
-            else
+            } else {
                 cr = null;
+            }
+
             first();
 
             // Deep Copy
@@ -228,8 +240,8 @@
             // TODO: should be the same granularity with RI using Debug tool
             // inspect!
             ((CachedRowSetImpl) output).setRows(data, columnCount);
-            output.setMetaData((RowSetMetaData) (this.getMetaData()));
-            output.originalResultSet = this.originalResultSet;
+            output.setMetaData((RowSetMetaData) (getMetaData()));
+            output.originalResultSet = originalResultSet;
             output.setUrl(getUrl());
             output.setTableName(getTableName());
 
@@ -240,6 +252,7 @@
 
             return output;
         } catch (CloneNotSupportedException e) {
+            // FIXME deal with the exception
             e.printStackTrace();
             return null;
         }
@@ -251,9 +264,10 @@
         try {
             result = (CachedRowSetImpl) super.clone();
             result.meta = (RowSetMetaDataImpl) meta;
-            result.keyCols = this.keyCols == null ? null : this.keyCols.clone();
+            result.keyCols = keyCols == null ? null : keyCols.clone();
             return result;
         } catch (CloneNotSupportedException e1) {
+            // FIXME deal with the exception
             return null;
         }
     }
@@ -261,11 +275,11 @@
     public RowSet createShared() throws SQLException {
         // shallow copy
         CachedRowSetImpl result = new CachedRowSetImpl();
-        result.rows = this.rows;
+        result.rows = rows;
 
-        result.currentRowIndex = this.currentRowIndex;
-        result.currentRow = this.currentRow;
-        result.meta = this.meta;
+        result.currentRowIndex = currentRowIndex;
+        result.currentRow = currentRow;
+        result.meta = meta;
 
         result.setReadOnly(isReadOnly());
         result.setConcurrency(super.getConcurrency());
@@ -277,8 +291,10 @@
     public void execute(Connection conn) throws SQLException {
         // ensure the getConnection can works!
         String localCommand = getCommand();
-        if (localCommand == null || getParams() == null)
+        if (localCommand == null || getParams() == null) {
+            // TODO add error messages
             throw new SQLException();
+        }
 
         PreparedStatement ps = conn.prepareStatement(localCommand);
         Object[] params = getParams();
@@ -299,12 +315,15 @@
     }
 
     public ResultSet getOriginalRow() throws SQLException {
-        if (currentRow == null)
+        if (currentRow == null) {
+            // TODO add error messages
             throw new SQLException();
+        }
+
         CachedRowSetImpl specialRset = new CachedRowSetImpl();
         ArrayList<CachedRow> data = new ArrayList<CachedRow>();
-        data.add(this.originalRow);
-        specialRset.setRows(data, this.columnCount);
+        data.add(originalRow);
+        specialRset.setRows(data, columnCount);
         return specialRset;
     }
 
@@ -317,7 +336,7 @@
     }
 
     public SyncProvider getSyncProvider() throws SQLException {
-        return this.syncProvider;
+        return syncProvider;
     }
 
     public String getTableName() throws SQLException {
@@ -325,7 +344,7 @@
     }
 
     /**
-     * refill the cachedrowset with pagesize, and the previous rowset was
+     * TODO refill the cachedrowset with pagesize, and the previous rowset was
      * replaced
      */
     public boolean nextPage() throws SQLException {
@@ -347,7 +366,7 @@
 
         originalResultSet = new CachedRowSetImpl();
         new CachedRowSetReader(this, startRow).readData(originalResultSet);
-        originalResultSet.setMetaData((RowSetMetaData) (this.getMetaData()));
+        originalResultSet.setMetaData((RowSetMetaData) (getMetaData()));
 
         // recovery the states
         currentRow = null;
@@ -379,11 +398,11 @@
             rowSetMetaData.setTableName(i, metaData.getTableName(i));
 
         }
-        this.meta = rowSetMetaData;
+        meta = rowSetMetaData;
     }
 
     public boolean previousPage() throws SQLException {
-        // TODO
+        // TODO implement it
         return false;
     }
 
@@ -413,13 +432,15 @@
     }
 
     public void setMetaData(RowSetMetaData md) throws SQLException {
-        this.meta = md;
+        meta = md;
     }
 
     public void setOriginalRow() throws SQLException {
 
-        if (currentRow == null)
+        if (currentRow == null) {
+            // TODO add error messages
             throw new SQLException();
+        }
         originalRow = currentRow;
         currentRow.setNonUpdateable();
 
@@ -430,9 +451,11 @@
             // rowset.2=Negative page size
             throw new SQLException(Messages.getString("rowset.2"));
         }
-        if ((getMaxRows() != 0) && (getMaxRows() < size))
+        if ((getMaxRows() != 0) && (getMaxRows() < size)) {
+            // rowset.9=PageSize can not larger than MaxRows
             throw new SQLException(Messages.getString("rowset.9"));
-        this.pageSize = size;
+        }
+        pageSize = size;
     }
 
     public void setSyncProvider(String provider) throws SQLException {
@@ -444,7 +467,7 @@
             // rowset.3=Table name should not be null
             throw new SQLException("rowset.3");
         }
-        this.tableName = tabName;
+        tableName = tabName;
     }
 
     public int size() {
@@ -464,10 +487,13 @@
     }
 
     public void undoDelete() throws SQLException {
-        if (currentRow == null)
+        if (currentRow == null) {
+            // TODO add error messages
             throw new SQLException();
-        if (currentRow.getDelete())
-            currentRow.unDoDelete();
+        }
+        if (currentRow.isDelete()) {
+            currentRow.undoDelete();
+        }
     }
 
     public void undoInsert() throws SQLException {
@@ -519,33 +545,40 @@
     }
 
     public boolean absolute(int row) throws SQLException {
-        if (rows.size() == 0)
+        if (rows.size() == 0) {
             return false;
-        if (getType() == ResultSet.TYPE_FORWARD_ONLY)
+        }
+        if (getType() == ResultSet.TYPE_FORWARD_ONLY) {
+            // TODO add error messages
             throw new SQLException();
+        }
         if (row < 0) {
             row = rows.size() + row + 1;
         } else if (row == 0) {
-            this.currentRowIndex = row;
-            this.currentRow = null;
+            currentRowIndex = row;
+            currentRow = null;
             return true;
         }
 
-        this.currentRowIndex = row;
-        this.currentRow = (CachedRow) rows.get(currentRowIndex - 1);
+        currentRowIndex = row;
+        currentRow = (CachedRow) rows.get(currentRowIndex - 1);
         return true;
     }
 
     public void afterLast() throws SQLException {
-        if (getType() == TYPE_FORWARD_ONLY)
+        if (getType() == TYPE_FORWARD_ONLY) {
+            // rowset.8=The Result Set Type is TYPE_FORWARD_ONLY
             throw new SQLException(Messages.getString("rowset.8"));
+        }
         currentRowIndex = rows.size() + 1;
         currentRow = null;
     }
 
     public void beforeFirst() throws SQLException {
-        if (getType() == TYPE_FORWARD_ONLY)
+        if (getType() == TYPE_FORWARD_ONLY) {
+            // rowset.8=The Result Set Type is TYPE_FORWARD_ONLY
             throw new SQLException(Messages.getString("rowset.8"));
+        }
         currentRowIndex = 0;
         currentRow = null;
     }
@@ -631,35 +664,55 @@
     }
 
     public Blob getBlob(int columnIndex) throws SQLException {
-        return this.currentRow.getBLOb(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return null;
+        }
+        return (Blob) value;
     }
 
     public Blob getBlob(String columnName) throws SQLException {
-        return this.currentRow.getBLOb(getIndexByName(columnName));
+        return getBlob(getIndexByName(columnName));
     }
 
     public boolean getBoolean(int columnIndex) throws SQLException {
-        return this.currentRow.getBoolean(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return false;
+        }
+        return ((Boolean) value).booleanValue();
     }
 
     public boolean getBoolean(String columnName) throws SQLException {
-        return this.currentRow.getBoolean(getIndexByName(columnName));
+        return getBoolean(getIndexByName(columnName));
     }
 
     public byte getByte(int columnIndex) throws SQLException {
-        return this.currentRow.getByte(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return 0;
+        }
+        return ((Byte) value).byteValue();
     }
 
     public byte getByte(String columnName) throws SQLException {
-        return this.currentRow.getByte(getIndexByName(columnName));
+        return getByte(getIndexByName(columnName));
     }
 
     public byte[] getBytes(int columnIndex) throws SQLException {
-        return this.currentRow.getBytes(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return null;
+        }
+        return (byte[]) value;
     }
 
     public byte[] getBytes(String columnName) throws SQLException {
-        return this.currentRow.getBytes(getIndexByName(columnName));
+        return getBytes(getIndexByName(columnName));
     }
 
     public Reader getCharacterStream(int columnIndex) throws SQLException {
@@ -716,11 +769,16 @@
 
     public int getInt(int columnIndex) throws SQLException {
         checkCursorValid();
-        return this.currentRow.getInt(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return 0;
+        }
+        return ((Integer) value).intValue();
     }
 
     public int getInt(String columnName) throws SQLException {
-        return this.currentRow.getInt(getIndexByName(columnName));
+        return getInt(getIndexByName(columnName));
     }
 
     public long getLong(int columnIndex) throws SQLException {
@@ -732,11 +790,11 @@
     }
 
     public ResultSetMetaData getMetaData() throws SQLException {
-        return this.meta;
+        return meta;
     }
 
     public Object getObject(int columnIndex) throws SQLException {
-        return this.currentRow.getObject(columnIndex);
+        return currentRow.getObject(columnIndex);
     }
 
     public Object getObject(int columnIndex, Map<String, Class<?>> map)
@@ -745,7 +803,7 @@
     }
 
     public Object getObject(String columnName) throws SQLException {
-        return this.currentRow.getObject(getIndexByName(columnName));
+        return currentRow.getObject(getIndexByName(columnName));
     }
 
     public Object getObject(String columnName, Map<String, Class<?>> map)
@@ -779,18 +837,24 @@
 
     // columnIndex: from 1 rather than 0
     public String getString(int columnIndex) throws SQLException {
-        return currentRow.getString(columnIndex);
+        checkValidRow();
+        Object value = currentRow.getObject(columnIndex);
+        if (value == null) {
+            return null;
+        }
+        return (String) value;
     }
 
     private boolean checkCursorValid() throws SQLException {
-        if ((currentRowIndex <= 0) || (currentRowIndex > rows.size()))
-            throw new SQLException(Messages.getString("rowset.7"));
-        else
-            return false;
+        if ((currentRowIndex <= 0) || (currentRowIndex > rows.size())) {
+            // rowset.7=Not a valid cursor
+            throw new SQLException(Messages.getString("rowset.7")); //$NON-NLS-1$
+        }
+        return false;
     }
 
     public String getString(String columnName) throws SQLException {
-        return currentRow.getString(getIndexByName(columnName));
+        return getString(getIndexByName(columnName));
     }
 
     public Time getTime(int columnIndex) throws SQLException {
@@ -882,18 +946,18 @@
 
     public void moveToCurrentRow() throws SQLException {
 
-        if (this.currentRow == this.insertRow) {
-            this.currentRowIndex = rememberedCursorPosition;
-            this.currentRow = rows.get(currentRowIndex - 1);
+        if (currentRow == insertRow) {
+            currentRowIndex = rememberedCursorPosition;
+            currentRow = rows.get(currentRowIndex - 1);
         }
 
     }
 
     public void moveToInsertRow() throws SQLException {
         insertRow = new CachedRow(new Object[columnCount]);
-        this.currentRow = insertRow;
-        this.rememberedCursorPosition = this.currentRowIndex;
-        this.currentRowIndex = rows.size();
+        currentRow = insertRow;
+        rememberedCursorPosition = currentRowIndex;
+        currentRowIndex = rows.size();
     }
 
     public boolean next() throws SQLException {
@@ -925,7 +989,7 @@
     public boolean rowDeleted() throws SQLException {
         checkValidRow();
         checkCursorValid();
-        return currentRow.getDelete();
+        return currentRow.isDelete();
     }
 
     public boolean rowInserted() throws SQLException {
@@ -934,14 +998,15 @@
          * FIXME: Determin the currentRow if have had a insertion 1. Need
          * traverse the rows and find if the data hava been added
          */
-        return this.currentRow.getInsert();
+        return currentRow.isInsert();
     }
 
     public boolean rowUpdated() throws SQLException {
 
         boolean sign = false;
-        for (int i = 0; i < meta.getColumnCount(); ++i)
-            sign = this.currentRow.getUpdateMask(i) | sign;
+        for (int i = 0; i < meta.getColumnCount(); ++i) {
+            sign = currentRow.getUpdateMask(i) | sign;
+        }
         return sign;
     }
 
@@ -1058,11 +1123,11 @@
     }
 
     public void updateInt(int columnIndex, int x) throws SQLException {
-        currentRow.updateInt(columnIndex, x);
+        currentRow.updateObject(columnIndex, x);
     }
 
     public void updateInt(String columnName, int x) throws SQLException {
-        currentRow.updateInt(getIndexByName(columnName), x);
+        updateInt(getIndexByName(columnName), x);
     }
 
     public void updateLong(int columnIndex, long x) throws SQLException {
@@ -1109,8 +1174,10 @@
 
     public void updateRow() throws SQLException {
         if ((currentRow == insertRow)
-                || (this.getConcurrency() == (ResultSet.CONCUR_READ_ONLY)))
+                || (getConcurrency() == (ResultSet.CONCUR_READ_ONLY))) {
+            // TODO add error messages
             throw new SQLException();
+        }
         rows.set(currentRowIndex, currentRow);
         notifyRowChanged();
     }
@@ -1124,11 +1191,11 @@
     }
 
     public void updateString(int columnIndex, String x) throws SQLException {
-        currentRow.updateString(columnIndex, x);
+        currentRow.updateObject(columnIndex, x);
     }
 
     public void updateString(String columnName, String x) throws SQLException {
-        currentRow.updateString(getIndexByName(columnName), x);
+        updateString(getIndexByName(columnName), x);
     }
 
     public void updateTime(int columnIndex, Time x) throws SQLException {

Modified: harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java?rev=596555&r1=596554&r2=596555&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/sql/src/main/java/org/apache/harmony/sql/internal/rowset/CachedRowSetWriter.java
Mon Nov 19 23:18:55 2007
@@ -158,12 +158,12 @@
         }
         updateCollector = subStringN(updateCollector, 3);
 
-        if (currentRowSet.getCurrentRow().getDelete()) {
+        if (currentRowSet.getCurrentRow().isDelete()) {
             // paras of where: pks
             sql = " delete from " + tableName + " where "
                     + whereStatementForCurrent;
             signal = 0;
-        } else if (currentRowSet.getCurrentRow().getInsert()) {
+        } else if (currentRowSet.getCurrentRow().isInsert()) {
             // paras of insert : all
             sql = " insert into " + tableName + " values " + " ( "
                     + insertCollector + " ) ";



Mime
View raw message