org.geotools.data.jdbc
Class ResultSetFIDReader

java.lang.Object
  extended byorg.geotools.data.jdbc.ResultSetFIDReader
All Implemented Interfaces:
FIDReader, QueryDataListener

public class ResultSetFIDReader
extends java.lang.Object
implements FIDReader, QueryDataListener

FIDReader for JDBC. Assumes that the column being passed in is a number, as the typeName is always appended on. This is because id's must start with a letter or an underscore. If needed we could only append the typeName if the column is an int.

Jody with an update - I test if it is a number, if it starts with letter or underscore I use it as is

Author:
Chris Holmes

Constructor Summary
ResultSetFIDReader(JDBCDataStore.QueryData queryData, java.lang.String typename, int column)
          Constructor that takes a QueryData object instead of a ResultSet.
ResultSetFIDReader(java.sql.ResultSet results, java.lang.String typeName, int column)
          Constructor, for a continuous array of result columns.
 
Method Summary
 void close()
          Release any resources associated with this reader
 boolean hasNext()
          Returns whether another fid exists for this reader.
 java.lang.String next()
          Gets the next FID from the Reader.
 void queryDataClosed(JDBCDataStore.QueryData queryData)
           
 void rowDeleted(JDBCDataStore.QueryData queryData)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResultSetFIDReader

public ResultSetFIDReader(java.sql.ResultSet results,
                          java.lang.String typeName,
                          int column)
Constructor, for a continuous array of result columns. If the geometry column.

Parameters:
results - The ResultSet to read attribute from.
typeName - The typename to append.
column - the offset at which the fid column is. Starts at 1, corresponding to the java ResultSet way of doing things.

ResultSetFIDReader

public ResultSetFIDReader(JDBCDataStore.QueryData queryData,
                          java.lang.String typename,
                          int column)
Constructor that takes a QueryData object instead of a ResultSet.

Parameters:
queryData - The queryData object
typename - The typename to preppend.
column - the offset at which the fid column is. Starts at 1, corresponding to the java ResultSet way of doing things.
Method Detail

hasNext

public boolean hasNext()
                throws java.io.IOException
Description copied from interface: FIDReader
Returns whether another fid exists for this reader.

Specified by:
hasNext in interface FIDReader
Returns:
true if more content exists
Throws:
java.io.IOException

next

public java.lang.String next()
                      throws java.io.IOException
Description copied from interface: FIDReader
Gets the next FID from the Reader.

Specified by:
next in interface FIDReader
Returns:
Next featureID
Throws:
java.io.IOException

close

public void close()
           throws java.io.IOException
Description copied from interface: FIDReader
Release any resources associated with this reader

Specified by:
close in interface FIDReader
Throws:
java.io.IOException

queryDataClosed

public void queryDataClosed(JDBCDataStore.QueryData queryData)
Specified by:
queryDataClosed in interface QueryDataListener

rowDeleted

public void rowDeleted(JDBCDataStore.QueryData queryData)
Specified by:
rowDeleted in interface QueryDataListener
Parameters:
queryData -
See Also:
QueryDataListener.rowDeleted(org.geotools.data.jdbc.JDBCDataStore.QueryData)


Copyright © 1996-2003 GeoTools. All Rights Reserved.