Package com.imsl.io

Class FlatFile

All Implemented Interfaces:
AutoCloseable, ResultSet, Wrapper
Direct Known Subclasses:
FlatFileEx1, FlatFileEx2

public class FlatFile extends AbstractFlatFile
Reads a text file as a ResultSet.

FlatFile extends AbstractFlatFile to handle text flat files.

As the file is read, it is split into lines using the BufferedReader.readLine(boolean, boolean[]) method. Each line is then split into tokens using a Tokenizer. Finally, each token string is converted into an Object using a Parser.

Parser is an interface defined within this class for converting a String into an Object. Parser objects for standard types are defined as static members of this class. By default, for each column its class is used to select one of these predefined parsers to parse that column.

See Also:
  • Field Details

  • Constructor Details

    • FlatFile

      public FlatFile(BufferedReader reader, Tokenizer tokenizer)
      Creates a FlatFile from a BufferedReader.
      Parameters:
      reader - a BufferedReader that is the stream to be read
      tokenizer - a Tokenizer that splits a text line into tokens, one per column
    • FlatFile

      public FlatFile(BufferedReader reader) throws IOException
      Creates a FlatFile with the CSV tokenizer.

      The CSV tokenizer is for reading comma separated value files.

      Parameters:
      reader - a BufferedReader that is the stream to be read
      Throws:
      IOException
    • FlatFile

      public FlatFile(String filename) throws IOException
      Creates a FlatFile from a CSV file.

      A CSV file is a comma separated value file.

      Parameters:
      filename - a String that specifies the name of the file to be read
      Throws:
      IOException
    • FlatFile

      public FlatFile(String filename, Tokenizer tokenizer) throws IOException
      Creates a FlatFile from a file.
      Parameters:
      filename - a String that specifies the name of the file to be read
      tokenizer - a Tokenizer that splits a text line into tokens, one per column
      Throws:
      IOException
  • Method Details

    • isWrapperFor

      public boolean isWrapperFor(Class<?> iface) throws SQLException
      Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively calling isWrapperFor on the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with the same argument should succeed.
      Parameters:
      iface - a Class defining an interface
      Returns:
      a boolean, false
      Throws:
      SQLException - if an error occurs while determining whether this is a wrapper for an object with the given interface
    • unwrap

      public <T> T unwrap(Class<T> iface) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy. If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise returns the result of calling unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is thrown.
      Type Parameters:
      T - the argument type to be unwrapped
      Parameters:
      iface - a Class defining an interface that the result must implement
      Returns:
      an object that implements the interface. The object may be a proxy for the actual implementing object.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateRowId

      public void updateRowId(int columnIndex, RowId x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a RowId value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a RowId that specifies the column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateRowId

      public void updateRowId(String columnLabel, RowId x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a RowId value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a RowId that specifies the column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getRowId

      public RowId getRowId(int columnIndex) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.RowId object in the Java programming language.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      a RowId that is the column value. If the value is a SQL NULL the value returned is null.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getRowId

      Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.RowId object in the Java programming language.
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      Returns:
      a RowId that is the column value. If the value is a SQL NULL the value returned is null.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getHoldability

      Retrieves the holdability of this ResultSet object.
      Returns:
      an int that is either ResultSet.HOLD_CURSORS_OVER_COMMIT or ResultSet.CLOSE_CURSORS_AT_COMMIT
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • isClosed

      Retrieves whether this ResultSet object has been closed. A ResultSet is closed if the method close has been called on it, or if it is automatically closed.
      Returns:
      a boolean, true if this ResultSet object is closed, false if it is still open
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateSQLXML

      public void updateSQLXML(int columnIndex, SQLXML xmlObject) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.SQLXML value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      xmlObject - a SQLXML object that specifies the value for the column to be updated
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getSQLXML

      public SQLXML getSQLXML(int columnIndex) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet as a java.sql.SQLXML object in the Java programming language.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      an SQLXML object that maps an SQL XML value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getSQLXML

      Retrieves the value of the designated column in the current row of this ResultSet as a java.sql.SQLXML object in the Java programming language.
      Parameters:
      columnLabel - an String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      Returns:
      an SQLXML object that maps an SQL XML value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getNClob

      public NClob getNClob(int columnIndex) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet object as a NClob object in the Java programming language.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      an NClob object representing the SQL NCLOB value in the specified column
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getNString

      public String getNString(int columnIndex) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language. It is intended for use when accessing NCHAR, NVARCHAR and LONGNVARCHAR columns.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      a String that specifies the column value. If the value is SQL NULL, the value returned is null.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getNString

      Retrieves the value of the designated column in the current row of this ResultSet object as a String in the Java programming language. It is intended for use when accessing NCHAR, NVARCHAR and LONGNVARCHAR columns.
      Parameters:
      columnLabel - an String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      Returns:
      a String that specifies the column value. If the value is SQL NULL, the value returned is null.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getNClob

      Retrieves the value of the designated column in the current row of this ResultSet object as a NClob object in the Java programming language.
      Parameters:
      columnLabel - an String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      Returns:
      an NClob object representing the SQL NCLOB value in the specified column
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateSQLXML

      public void updateSQLXML(String columnLabel, SQLXML xmlObject) throws SQLFeatureNotSupportedException
      Updates the designated column with a java.sql.SQLXML value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      xmlObject - a SQLXML object the specifies the column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
      SQLFeatureNotSupportedException
    • getNCharacterStream

      public Reader getNCharacterStream(int columnIndex) throws SQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet object as a java.io.Reader object. It is intended for use when accessing NCHAR, NVARCHAR and LONGNVARCHAR columns.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      a java.io.Reader object that contains the column value. If the value is SQL NULL, the value returned is null in the Java programming language.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
      SQLFeatureNotSupportedException
    • updateNString

      public void updateNString(int columnIndex, String nString) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a String value. It is intended for use when updating, NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      nString - a String that specifies the value for the column to be updated
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNString

      public void updateNString(String columnLabel, String nString) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a String value. It is intended for use when updating NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      nString - a String that specifies the value for the column to be updated
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getNCharacterStream

      public Reader getNCharacterStream(String columnLabel) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Retrieves the value of the designated column in the current row of this ResultSet object as a java.io.Reader object. It is intended for use when accessing NCHAR, NVARCHAR and LONGNVARCHAR columns.
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      Returns:
      a java.io.Reader object that contains the column value. If the value is SQL NULL, the value returned is null in the Java programming language.
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(int columnIndex, InputStream x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(int columnIndex, InputStream x, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateAsciiStream in interface ResultSet
      Overrides:
      updateAsciiStream in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(int columnIndex, InputStream x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(String columnLabel, InputStream x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(String columnLabel, InputStream x, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateAsciiStream in interface ResultSet
      Overrides:
      updateAsciiStream in class AbstractFlatFile
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateAsciiStream

      public void updateAsciiStream(String columnLabel, InputStream x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with an ASCII stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(int columnIndex, InputStream x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(int columnIndex, InputStream x, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateBinaryStream in interface ResultSet
      Overrides:
      updateBinaryStream in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(int columnIndex, InputStream x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a InputStream that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(String columnLabel, InputStream x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(String columnLabel, InputStream x, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateBinaryStream in interface ResultSet
      Overrides:
      updateBinaryStream in class AbstractFlatFile
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBinaryStream

      public void updateBinaryStream(String columnLabel, InputStream x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a binary stream value. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a InputStream that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(int columnIndex, Blob x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.Blob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateBlob in interface ResultSet
      Overrides:
      updateBlob in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Blob that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(int columnIndex, InputStream inputStream) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given input stream. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      inputStream - an InputStream that contains the data to set the parameter value to
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(int columnIndex, InputStream inputStream, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given input stream, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      inputStream - an InputStream that contains the data to set the parameter value to
      length - an long that specifies the number of bytes in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(String columnLabel, Blob x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.Blob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateBlob in interface ResultSet
      Overrides:
      updateBlob in class AbstractFlatFile
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a Blob that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(String columnLabel, InputStream inputStream) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given input stream. The data will be read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      inputStream - an InputStream that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateBlob

      public void updateBlob(String columnLabel, InputStream inputStream, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given input stream, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      inputStream - an InputStream that specifies the new column value
      length - an long that specifies the number of bytes in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(int columnIndex, Reader x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value. The data is read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(int columnIndex, Reader x, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateCharacterStream in interface ResultSet
      Overrides:
      updateCharacterStream in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Reader that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(int columnIndex, Reader x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Reader that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(String columnLabel, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value. The data is read from the stream as needed until end-of-stream is reached.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(String columnLabel, Reader reader, int length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateCharacterStream in interface ResultSet
      Overrides:
      updateCharacterStream in class AbstractFlatFile
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      length - an int that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateCharacterStream

      public void updateCharacterStream(String columnLabel, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      length - an long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(int columnIndex, Clob x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.Clob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateClob in interface ResultSet
      Overrides:
      updateClob in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Clob that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(int columnIndex, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object. The data is read from the stream as needed until end-of-stream is reached. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      reader - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(int columnIndex, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      reader - a Reader that specifies the new column value
      length - a long that specifies the number of characters in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(String columnLabel, Clob x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.Clob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Specified by:
      updateClob in interface ResultSet
      Overrides:
      updateClob in class AbstractFlatFile
      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      x - a Clob that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(String columnLabel, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object. The data is read from the stream as needed until end-of-stream is reached. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateClob

      public void updateClob(String columnLabel, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      length - a long that specifies the number of characters in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNCharacterStream

      public void updateNCharacterStream(int columnIndex, Reader x) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value. The data is read from the stream as needed until end-of-stream is reached. The driver does the necessary conversion from Java character format to the national character set in the database. It is intended for use when updating NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNCharacterStream

      public void updateNCharacterStream(int columnIndex, Reader x, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes. The driver does the necessary conversion from Java character format to the national character set in the database. It is intended for use when updating NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      x - a Reader that specifies the new column value
      length - a long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNCharacterStream

      public void updateNCharacterStream(String columnLabel, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value. The data is read from the stream as needed until end-of-stream is reached. The driver does the necessary conversion from Java character format to the national character set in the database. It is intended for use when updating NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNCharacterStream

      public void updateNCharacterStream(String columnLabel, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a character stream value, which is the specified number of bytes. The driver does the necessary conversion from Java character format to the national character set in the database. It is intended for use when updating NCHAR, NVARCHAR and LONGNVARCHAR columns.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that specifies the new column value
      length - a long that specifies the length of the stream
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(int columnIndex, NClob nClob) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.NClob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      nClob - an NClob that specifies the value for the column to be updated
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(int columnIndex, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader. The data is read from the stream as needed until end-of-stream is reached. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      reader - a Reader that contains the data to set the parameter value to
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(int columnIndex, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      reader - a Reader that contains the data to set the parameter value to
      length - a long that specifies the number of characters in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(String columnLabel, NClob nClob) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column with a java.sql.NClob value.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      nClob - a NClob that specifies the value for the column to be updated
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(String columnLabel, Reader reader) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object. The data is read from the stream as needed until end-of-stream is reached. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that contains the data to set the parameter value to
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • updateNClob

      public void updateNClob(String columnLabel, Reader reader, long length) throws AbstractFlatFile.FlatFileSQLFeatureNotSupportedException
      Updates the designated column using the given Reader object, which is the given number of characters long. When a very large UNICODE value is input to a LONGVARCHAR parameter, it may be more practical to send it via a java.io.Reader object. The JDBC driver does any necessary conversion from UNICODE to the database char format.

      The updater methods are used to update column values in the current row or the insert row. The updater methods do not update the underlying database. Instead the updateRow or insertRow methods are called to update the database.

      Parameters:
      columnLabel - a String that indicates the label for the column specified with the SQL AS clause. If the SQL AS clause was not specified, then the label is the name of the column.
      reader - a Reader that contains the data to set the parameter value to
      length - a long that specifies the number of characters in the parameter data
      Throws:
      AbstractFlatFile.FlatFileSQLFeatureNotSupportedException - this feature has not been implemented
    • getObject

      public Object getObject(int columnIndex) throws SQLException

      Gets the value of the designated column in the current row of this ResultSet object as an Object in the Java programming language.

      This method returns the value of the given column as a Java object. The type of the Java object is the default Java object type corresponding to the column's SQL type, following the mapping for built-in types specified in the JDBC specification.

      This method may also be used to read datatabase-specific abstract data types. In the JDBC 2.0 API, the behavior of method getObject is extended to materialize data of SQL user-defined types. When a column contains a structured or distinct value, the behavior of this method is as if it were a call to: getObject(columnIndex, this.getStatement().getConnection().getTypeMap()).

      Specified by:
      getObject in interface ResultSet
      Specified by:
      getObject in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      a java.lang.Object holding the column value
      Throws:
      SQLException - if a database access error occurs
    • readLine

      protected String readLine() throws IOException
      Reads and returns a line from the input.
      Returns:
      a String that contains a line from the input
      Throws:
      IOException - thrown if an IO exception occurs
    • setColumnClass

      protected void setColumnClass(int columnIndex, Class columnClass)
      Sets a column class.
      Overrides:
      setColumnClass in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      columnClass - a Class object used to specify the class of the data in the column
    • setColumnParser

      protected void setColumnParser(int columnIndex, FlatFile.Parser columnParser)
      Sets the Parser for the specified column.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      columnParser - a Parser that is the parser to be used to parse entries in the specified column
    • setDateColumnParser

      protected void setDateColumnParser(int columnIndex, String pattern, Locale locale)
      Creates for a pattern string and sets the Parser for the specified column.
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      pattern - a String that specifies a pattern used to construct a java.text.SimpleDateFormat object used to parse the column
      locale - a Locale that specifies the locale for the date format parser
    • doNext

      protected boolean doNext() throws SQLException
      Moves the cursor down one row from its current position. A ResultSet cursor is initially positioned before the first row, the first call to the method next makes the first row the current row, the second call makes the second row the current row, and so on.
      Specified by:
      doNext in class AbstractFlatFile
      Returns:
      a boolean, true if the new current row is valid, false if there are no more rows
      Throws:
      SQLException - if a database access error occurs
    • doGetBytes

      protected byte[] doGetBytes(int columnIndex) throws SQLException
      Gets the value of the designated column in the current row as a byte array.
      Specified by:
      doGetBytes in class AbstractFlatFile
      Parameters:
      columnIndex - an int that specifies the column. The first column is 1, the second 2, and so on.
      Returns:
      a byte array that contains the column value. If the value is SQL NULL, the value returned is null.
      Throws:
      SQLException - if a database access error occurs
    • getColumnCount

      public int getColumnCount() throws SQLException
      Returns the number of columns in this ResultSet object.
      Specified by:
      getColumnCount in class AbstractFlatFile
      Returns:
      an int that specifies the number of columns
      Throws:
      SQLException - if a database access error occurs