|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.geotools.data.AbstractAttributeIO
org.geotools.data.jdbc.ResultSetAttributeIO
Provides an AttriuteReader over a result set limiting the columns to a defined range. This uses the default SQL->Java type mappings of the result set.
Ranges are based on JDBC ResultSet column indexes which begin at 1
This reader does not handle any geometries.
Field Summary |
Fields inherited from class org.geotools.data.AbstractAttributeIO |
metaData |
Constructor Summary | |
ResultSetAttributeIO(AttributeType[] metadata,
JDBCDataStore.QueryData querydata,
int startColumn,
int endColumn)
Creates a new RangedResultSetAttributeReader. |
Method Summary | |
void |
close()
This closes the QueryData object that the Read was constructed with. |
boolean |
hasNext()
Returns true if there are more rows. |
boolean |
isClosed()
|
void |
next()
Moves to the next row in the result set. |
void |
queryDataClosed(JDBCDataStore.QueryData queryData)
|
java.lang.Object |
read(int i)
Reads an attribute from the given column in the current row. |
void |
rowDeleted(JDBCDataStore.QueryData queryData)
|
void |
write(int position,
java.lang.Object attribute)
This writes the attribute to the position within the ResultSet. |
Methods inherited from class org.geotools.data.AbstractAttributeIO |
copy, getAttributeCount, getAttributeType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.geotools.data.AttributeWriter |
getAttributeCount, getAttributeType |
Methods inherited from interface org.geotools.data.AttributeReader |
getAttributeCount, getAttributeType |
Constructor Detail |
public ResultSetAttributeIO(AttributeType[] metadata, JDBCDataStore.QueryData querydata, int startColumn, int endColumn)
metadata
- The meta data of the columns.startColumn
- The starting column, inclusive.endColumn
- The ending index, exclusive.Method Detail |
public void close() throws java.io.IOException
This method will also set a flag to indicate that the results have been closed elsewhere and future calls to the read methods of the reader will throw errors.
close
in interface AttributeWriter
java.io.IOException
- This will never be thrown by this class.AttributeReader.close()
public boolean hasNext() throws java.io.IOException
hasNext
in interface AttributeWriter
java.io.IOException
- This will only occur if an SQLException occurs
on the result set.AttributeReader.hasNext()
public void next() throws java.io.IOException
next
in interface AttributeWriter
java.io.IOException
AttributeReader.next()
public java.lang.Object read(int i) throws java.io.IOException, java.lang.ArrayIndexOutOfBoundsException
read
in interface AttributeReader
i
- The zero based index into the attributes of this attribute reader.
This index is based on the index of the attribute in the array of AttributeTypes
this Reader uses as meta data. The index is internally mapped to the result set
column index so this is transparent to the user.
java.io.IOException
- If an error occurs setting thr row or retreiving the value
from the column or the Reader has previously bee closed.
java.lang.ArrayIndexOutOfBoundsException
- If the index passed as i is greater than
the number of attributes in the schema or outside the range of this reader.
i is outside the range of the reader if (startColumn + i) < startColumn
or (startColumn + i) >= endColumn.AttributeReader.read(int)
public void write(int position, java.lang.Object attribute) throws java.io.IOException
Currently uses the update methods of result set to write the data.
write
in interface AttributeWriter
java.io.IOException
AttributeWriter.write(int, java.lang.Object)
public void queryDataClosed(JDBCDataStore.QueryData queryData)
queryDataClosed
in interface QueryDataListener
public void rowDeleted(JDBCDataStore.QueryData queryData)
rowDeleted
in interface QueryDataListener
queryData
- QueryDataListener.rowDeleted(org.geotools.data.jdbc.JDBCDataStore.QueryData)
public boolean isClosed()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |