cmu.survey.data.mysql
Class DataTableModelMySQL.ForwardOnlyDataSQL

java.lang.Object
  extended by cmu.survey.data.mysql.DataTableModelMySQL.ForwardOnlyDataSQL
All Implemented Interfaces:
ForwardOnlyData
Enclosing class:
DataTableModelMySQL

public class DataTableModelMySQL.ForwardOnlyDataSQL
extends java.lang.Object
implements ForwardOnlyData


Constructor Summary
DataTableModelMySQL.ForwardOnlyDataSQL(java.lang.String query)
           
 
Method Summary
protected  boolean checkHandleColumnFormatBad(java.lang.String columnName, java.lang.Object data, java.lang.Class expectedColumnType)
           
 void close()
          Call when done accessing this ForwardOnlyData.
 void deleteRecord()
          Deletes the current row -- this method can only be called after you call moveToNextRecord() and it returns true.
 java.lang.Object getData(int columnIndex)
          ColumnIndex starts at 0.
 java.lang.Object getData(java.lang.String columnName)
           
 java.util.Date getDateData(java.lang.String columnName)
           
 java.lang.Integer getIntegerData(java.lang.String columnName)
           
 java.lang.String getStringData(java.lang.String columnName)
           
 boolean isOpen()
          If the set is open
 boolean moveToNextRecord()
          Moves to the next record, and if it succeeds, returns true.
 void setData(java.lang.String columnName, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataTableModelMySQL.ForwardOnlyDataSQL

public DataTableModelMySQL.ForwardOnlyDataSQL(java.lang.String query)
                                       throws FailedRequest
Throws:
FailedRequest
Method Detail

checkHandleColumnFormatBad

protected boolean checkHandleColumnFormatBad(java.lang.String columnName,
                                             java.lang.Object data,
                                             java.lang.Class expectedColumnType)
                                      throws FailedRequest
Throws:
FailedRequest

isOpen

public boolean isOpen()
Description copied from interface: ForwardOnlyData
If the set is open

Specified by:
isOpen in interface ForwardOnlyData
Returns:

moveToNextRecord

public boolean moveToNextRecord()
                         throws FailedRequest.AlreadyClosedError
Description copied from interface: ForwardOnlyData
Moves to the next record, and if it succeeds, returns true. Returns false if (a) there are no more records, or if (b) it can't go on to the next record due to a database error

Specified by:
moveToNextRecord in interface ForwardOnlyData
Returns:
whether going on to the next record succeeded
Throws:
FailedRequest.AlreadyClosedError - if the ForwardOnlyData has already been closed manually

getData

public java.lang.Object getData(int columnIndex)
                         throws FailedRequest
Description copied from interface: ForwardOnlyData
ColumnIndex starts at 0.

Specified by:
getData in interface ForwardOnlyData
Parameters:
columnIndex - starting at 0.
Returns:
Throws:
FailedRequest

getData

public java.lang.Object getData(java.lang.String columnName)
                         throws FailedRequest
Specified by:
getData in interface ForwardOnlyData
Throws:
FailedRequest

getStringData

public java.lang.String getStringData(java.lang.String columnName)
                               throws FailedRequest
Specified by:
getStringData in interface ForwardOnlyData
Throws:
FailedRequest

getIntegerData

public java.lang.Integer getIntegerData(java.lang.String columnName)
                                 throws FailedRequest
Specified by:
getIntegerData in interface ForwardOnlyData
Throws:
FailedRequest

getDateData

public java.util.Date getDateData(java.lang.String columnName)
                           throws FailedRequest
Specified by:
getDateData in interface ForwardOnlyData
Throws:
FailedRequest

setData

public void setData(java.lang.String columnName,
                    java.lang.Object value)
             throws FailedRequest
Specified by:
setData in interface ForwardOnlyData
Throws:
FailedRequest

deleteRecord

public void deleteRecord()
                  throws FailedRequest
Description copied from interface: ForwardOnlyData
Deletes the current row -- this method can only be called after you call moveToNextRecord() and it returns true. This does NOT move to the next record -- until you call "moveToNextRecord()" again, you cannot call any getData() methods.

Specified by:
deleteRecord in interface ForwardOnlyData
Throws:
FailedRequest

close

public void close()
Description copied from interface: ForwardOnlyData
Call when done accessing this ForwardOnlyData.

Specified by:
close in interface ForwardOnlyData