db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kahat...@apache.org
Subject svn commit: r1181713 - in /db/derby/code/trunk/java/client/org/apache/derby/client: am/Cursor.java net/NetCursor.java
Date Tue, 11 Oct 2011 11:11:41 GMT
Author: kahatlen
Date: Tue Oct 11 11:11:40 2011
New Revision: 1181713

URL: http://svn.apache.org/viewvc?rev=1181713&view=rev
Log:
DERBY-5453: Remove unused methods in Cursor and NetCursor

Modified:
    db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
    db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/am/Cursor.java?rev=1181713&r1=1181712&r2=1181713&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 Oct 11 11:11:40
2011
@@ -126,12 +126,6 @@ public abstract class Cursor {
         dataBufferStream_ = new java.io.ByteArrayOutputStream();
     }
 
-    public Cursor(Agent agent, byte[] dataBuffer) {
-        this(agent);
-        dataBuffer_ = dataBuffer;
-        setAllRowsReceivedFromServer(false);
-    }
-
     public void setNumberOfColumns(int numberOfColumns) {
         columnDataPosition_ = new int[numberOfColumns];
         columnDataComputedLength_ = new int[numberOfColumns];
@@ -263,11 +257,6 @@ public abstract class Cursor {
 
     protected abstract void getMoreData_() throws SqlException;
 
-    // Associate a new underlying COM or SQLDA output data buffer for this converter.
-    public final void setBuffer(byte[] dataBuffer) {
-        dataBuffer_ = dataBuffer;
-    }
-
     public final void setIsUpdataDeleteHole(int row, boolean isRowNull) {
         isUpdateDeleteHole_ = isRowNull;
         Boolean nullIndicator = (isUpdateDeleteHole_ == true) ? ROW_IS_NULL : ROW_IS_NOT_NULL;
@@ -311,18 +300,6 @@ public abstract class Cursor {
     
     //---------------------------cursor positioning-------------------------------
 
-    final int getPosition() {
-        return position_;
-    }
-
-    final void setPosition(int newPosition) {
-        position_ = newPosition;
-    }
-
-    public final void markCurrentRowPosition() {
-        currentRowPosition_ = position_;
-    }
-
     public final void markNextRowPosition() {
         nextRowPosition_ = position_;
     }
@@ -331,26 +308,6 @@ public abstract class Cursor {
         currentRowPosition_ = nextRowPosition_;
     }
 
-    final void repositionCursorToCurrentRow() {
-        position_ = currentRowPosition_;
-    }
-
-    final void repositionCursorToNextRow() {
-        position_ = nextRowPosition_;
-    }
-
-    public final byte[] getDataBuffer() {
-        return dataBuffer_;
-    }
-
-    public final int getDataBufferLength() {
-        return dataBuffer_.length;
-    }
-
-    public final int getLastValidBytePosition() {
-        return lastValidBytePosition_;
-    }
-
     // This tracks the total number of rows read into the client side buffer for
     // this result set, irregardless of scrolling.
     // Per jdbc semantics, this should never exceed statement.maxRows.
@@ -764,9 +721,6 @@ public abstract class Cursor {
                                         boolean toBePublished)
             throws SqlException;
 
-    // get the raw clob bytes, without translation.  dataOffset must be int[1]
-    abstract public byte[] getClobBytes_(int column, int[] dataOffset /*output*/) throws
SqlException;
-
     //------- the following getters perform any necessary cross-conversion _------
 
     final boolean getBoolean(int column) throws SqlException {
@@ -1431,13 +1385,4 @@ public abstract class Cursor {
     private final int getColumnScale(int column) {
         return (fdocaLength_[column] & 0xff);
     }
-
-    // Only used by Sqlca.getMessage() when using a locale encoding
-    // to convert errror message text instead of relying on server encoding as usual.
-    final byte[] getBytesFromVARCHAR(int column) throws SqlException {
-        byte[] bytes;
-        bytes = new byte[columnDataComputedLength_[column - 1] - 2];
-        System.arraycopy(dataBuffer_, columnDataPosition_[column - 1] + 2, bytes, 0, bytes.length);
-        return bytes;
-    }
 }

Modified: db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java?rev=1181713&r1=1181712&r2=1181713&view=diff
==============================================================================
--- db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java (original)
+++ db/derby/code/trunk/java/client/org/apache/derby/client/net/NetCursor.java Tue Oct 11
11:11:40 2011
@@ -386,32 +386,6 @@ public class NetCursor extends org.apach
         }
     }
 
-    protected boolean isDataBufferNull() {
-        if (dataBuffer_ == null) {
-            return true;
-        } else {
-            return false;
-        }
-    }
-
-    protected void allocateDataBuffer() {
-        int length;
-        if (maximumRowSize_ > DssConstants.MAX_DSS_LEN) {
-            length = maximumRowSize_;
-        } else {
-            length = DssConstants.MAX_DSS_LEN;
-        }
-
-        dataBuffer_ = new byte[length];
-        position_ = 0;
-        lastValidBytePosition_ = 0;
-    }
-
-    protected void allocateDataBuffer(int length) {
-        dataBuffer_ = new byte[length];
-    }
-
-
     private int readFdocaInt() throws org.apache.derby.client.am.DisconnectException, SqlException
{
         checkForSplitRowAndComplete(4);
         int i = SignedBinary.getInt(dataBuffer_, position_);
@@ -899,14 +873,6 @@ public class NetCursor extends org.apach
         isNull_ = new boolean[columns_];
     }
 
-    void setBlocking(int queryProtocolType) {
-        if (queryProtocolType == CodePoint.LMTBLKPRC) {
-            blocking_ = true;
-        } else {
-            blocking_ = false;
-        }
-    }
-
     protected byte[] findExtdtaData(int column) {
         byte[] data = null;
 
@@ -1029,26 +995,6 @@ public class NetCursor extends org.apach
         return clob;
     }
 
-    public byte[] getClobBytes_(int column, int[] dataOffset /*output*/) throws SqlException
{
-        int index = column - 1;
-        byte[] data = null;
-
-        // locate the EXTDTA bytes, if any
-        data = findExtdtaData(column);
-
-        if (data != null) {
-            // data found
-            // set data offset based on the presence of a null indicator
-            if (!nullable_[index]) {
-                dataOffset[0] = 0;
-            } else {
-                dataOffset[0] = 1;
-            }
-        }
-
-        return data;
-    }
-
     // this is really an event-callback from NetStatementReply.parseSQLDTARDarray()
     void initializeColumnInfoArrays(Typdef typdef,
                                     int columnCount, int targetSqlamForTypdef) throws DisconnectException
{
@@ -1062,47 +1008,6 @@ public class NetCursor extends org.apach
         targetSqlamForTypdef_ = targetSqlamForTypdef;
     }
 
-
-    int ensureSpaceForDataBuffer(int ddmLength) {
-        if (dataBuffer_ == null) {
-            allocateDataBuffer();
-        }
-        //super.resultSet.cursor.clearColumnDataOffsetsCache();
-        // Need to know how many bytes to ask from the Reply object,
-        // and handle the case where buffer is not big enough for all the bytes.
-        // Get the length in front of the code point first.
-
-        int bytesAvailableInDataBuffer = dataBuffer_.length - lastValidBytePosition_;
-
-        // Make sure the buffer has at least ddmLength amount of room left.
-        // If not, expand the buffer before calling the getQrydtaData() method.
-        if (bytesAvailableInDataBuffer < ddmLength) {
-
-            // Get a new buffer that is twice the size of the current buffer.
-            // Copy the contents from the old buffer to the new buffer.
-            int newBufferSize = 2 * dataBuffer_.length;
-
-            while (newBufferSize < ddmLength) {
-                newBufferSize = 2 * newBufferSize;
-            }
-
-            byte[] tempBuffer = new byte[newBufferSize];
-
-            System.arraycopy(dataBuffer_,
-                    0,
-                    tempBuffer,
-                    0,
-                    lastValidBytePosition_);
-
-            // Make the new buffer the dataBuffer.
-            dataBuffer_ = tempBuffer;
-
-            // Recalculate bytesAvailableInDataBuffer
-            bytesAvailableInDataBuffer = dataBuffer_.length - lastValidBytePosition_;
-        }
-        return bytesAvailableInDataBuffer;
-    }
-
     protected void getMoreData_() throws SqlException {
         // reset the dataBuffer_ before getting more data if cursor is foward-only.
         // getMoreData() is only called in Cursor.next() when current position is



Mime
View raw message