Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.mysql.jdbc
Class RowDataDynamic  view RowDataDynamic download RowDataDynamic.java

java.lang.Object
  extended bycom.mysql.jdbc.RowDataDynamic
All Implemented Interfaces:
RowData

public class RowDataDynamic
extends java.lang.Object
implements RowData

Allows streaming of MySQL data.

Version:
$Id: RowDataDynamic.java,v 1.8.2.9 2004/08/09 22:15:10 mmatthew Exp $

Nested Class Summary
(package private)  class RowDataDynamic.OperationNotSupportedException
           
 
Field Summary
private  int columnCount
           
private  int index
           
private  MysqlIO io
           
private  boolean isAfterEnd
           
private  boolean isAtEnd
           
private  long lastSuccessfulReadTimeMs
           
private  long netWriteTimeoutMs
           
private  byte[][] nextRow
           
private  ResultSet owner
           
private  boolean streamerClosed
           
 
Fields inherited from interface com.mysql.jdbc.RowData
RESULT_SET_SIZE_UNKNOWN
 
Constructor Summary
RowDataDynamic(MysqlIO io, int colCount)
          Creates a new RowDataDynamic object.
 
Method Summary
 void addRow(byte[][] row)
          Adds a row to this row data.
 void afterLast()
          Moves to after last.
 void beforeFirst()
          Moves to before first.
 void beforeLast()
          Moves to before last so next el is the last el.
 void close()
          We're done.
 byte[][] getAt(int index)
          Only works on non dynamic result sets.
 int getCurrentRowNumber()
          Returns the current position in the result set as a row number.
 ResultSet getOwner()
          Returns the result set that 'owns' this RowData
 boolean hasNext()
          Returns true if another row exsists.
 boolean isAfterLast()
          Returns true if we got the last element.
 boolean isBeforeFirst()
          Returns if iteration has not occured yet.
 boolean isDynamic()
          Returns true if the result set is dynamic.
 boolean isEmpty()
          Has no records.
 boolean isFirst()
          Are we on the first row of the result set?
 boolean isLast()
          Are we on the last row of the result set?
 void moveRowRelative(int rows)
          Moves the current position relative 'rows' from the current position.
 byte[][] next()
          Returns the next row.
private  void nextRecord()
           
private  void notSupported()
           
 void removeRow(int index)
          Removes the row at the given index.
 void setCurrentRow(int rowNumber)
          Moves the current position in the result set to the given row number.
 void setOwner(ResultSet rs)
          Set the result set that 'owns' this RowData
 int size()
          Only works on non dynamic result sets.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

io

private MysqlIO io

nextRow

private byte[][] nextRow

isAfterEnd

private boolean isAfterEnd

isAtEnd

private boolean isAtEnd

streamerClosed

private boolean streamerClosed

columnCount

private int columnCount

index

private int index

lastSuccessfulReadTimeMs

private long lastSuccessfulReadTimeMs

netWriteTimeoutMs

private long netWriteTimeoutMs

owner

private ResultSet owner
Constructor Detail

RowDataDynamic

public RowDataDynamic(MysqlIO io,
                      int colCount)
               throws java.sql.SQLException
Creates a new RowDataDynamic object.

Method Detail

isAfterLast

public boolean isAfterLast()
                    throws java.sql.SQLException
Returns true if we got the last element.

Specified by:
isAfterLast in interface RowData

getAt

public byte[][] getAt(int index)
               throws java.sql.SQLException
Only works on non dynamic result sets.

Specified by:
getAt in interface RowData

isBeforeFirst

public boolean isBeforeFirst()
                      throws java.sql.SQLException
Returns if iteration has not occured yet.

Specified by:
isBeforeFirst in interface RowData

setCurrentRow

public void setCurrentRow(int rowNumber)
                   throws java.sql.SQLException
Moves the current position in the result set to the given row number.

Specified by:
setCurrentRow in interface RowData

setOwner

public void setOwner(ResultSet rs)
Description copied from interface: RowData
Set the result set that 'owns' this RowData

Specified by:
setOwner in interface RowData

getOwner

public ResultSet getOwner()
Description copied from interface: RowData
Returns the result set that 'owns' this RowData

Specified by:
getOwner in interface RowData

getCurrentRowNumber

public int getCurrentRowNumber()
                        throws java.sql.SQLException
Returns the current position in the result set as a row number.

Specified by:
getCurrentRowNumber in interface RowData

isDynamic

public boolean isDynamic()
Returns true if the result set is dynamic. This means that move back and move forward won't work because we do not hold on to the records.

Specified by:
isDynamic in interface RowData

isEmpty

public boolean isEmpty()
                throws java.sql.SQLException
Has no records.

Specified by:
isEmpty in interface RowData

isFirst

public boolean isFirst()
                throws java.sql.SQLException
Are we on the first row of the result set?

Specified by:
isFirst in interface RowData

isLast

public boolean isLast()
               throws java.sql.SQLException
Are we on the last row of the result set?

Specified by:
isLast in interface RowData

addRow

public void addRow(byte[][] row)
            throws java.sql.SQLException
Adds a row to this row data.

Specified by:
addRow in interface RowData

afterLast

public void afterLast()
               throws java.sql.SQLException
Moves to after last.

Specified by:
afterLast in interface RowData

beforeFirst

public void beforeFirst()
                 throws java.sql.SQLException
Moves to before first.

Specified by:
beforeFirst in interface RowData

beforeLast

public void beforeLast()
                throws java.sql.SQLException
Moves to before last so next el is the last el.

Specified by:
beforeLast in interface RowData

close

public void close()
           throws java.sql.SQLException
We're done.

Specified by:
close in interface RowData

hasNext

public boolean hasNext()
                throws java.sql.SQLException
Returns true if another row exsists.

Specified by:
hasNext in interface RowData

moveRowRelative

public void moveRowRelative(int rows)
                     throws java.sql.SQLException
Moves the current position relative 'rows' from the current position.

Specified by:
moveRowRelative in interface RowData

next

public byte[][] next()
              throws java.sql.SQLException
Returns the next row.

Specified by:
next in interface RowData

removeRow

public void removeRow(int index)
               throws java.sql.SQLException
Removes the row at the given index.

Specified by:
removeRow in interface RowData

size

public int size()
Only works on non dynamic result sets.

Specified by:
size in interface RowData

nextRecord

private void nextRecord()
                 throws java.sql.SQLException

notSupported

private void notSupported()
                   throws java.sql.SQLException