|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object prefuse.data.io.sql.DefaultSQLDataHandler
public class DefaultSQLDataHandler
Default data value handler for mapping SQL data types to Java objects. Performs a straightforward mapping of common SQL data types to Java primitives or objects.
Constructor Summary | |
---|---|
DefaultSQLDataHandler()
Create a new DefaultSQLDataHandler. |
|
DefaultSQLDataHandler(boolean ignoreUnknownTypes)
Create a new DefaultSQLDataHandler. |
Method Summary | |
---|---|
java.lang.Class |
getDataType(java.lang.String columnName,
int sqlType)
Return the Java data type for the given data field name and its sql data type. |
boolean |
isIgnoreUnknownTypes()
Indicates if unknown or unrecognized SQL data types should simply be ignored. |
void |
process(Table t,
int trow,
java.sql.ResultSet rset,
int rcol)
Process a data value from a ResultSet, translating it into a Java data value and storing it in a Table. |
void |
setIgnoreUnknownTypes(boolean ignore)
Set if unknown or unrecognized SQL data types should simply be ignored. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultSQLDataHandler()
public DefaultSQLDataHandler(boolean ignoreUnknownTypes)
ignoreUnknownTypes
- instructs the data handler whether or not
unknown or unrecognized SQL data types should simply be ignoredMethod Detail |
---|
public void setIgnoreUnknownTypes(boolean ignore)
ignore
- the ignore unknown types setting to usepublic boolean isIgnoreUnknownTypes()
public void process(Table t, int trow, java.sql.ResultSet rset, int rcol) throws java.sql.SQLException
SQLDataHandler
process
in interface SQLDataHandler
t
- the Table in which to store the result valuetrow
- the Table row to add torset
- the ResultSet to read the SQL value from, assumed
to be set to the desired rowrcol
- the column index of the data value in the row set.
This is also used to look up the column name, which is used
to access the correct data field of the Table.
java.sql.SQLException
- if an error occurs accessing the ResultSetSQLDataHandler.process(prefuse.data.Table, int, java.sql.ResultSet, int)
public java.lang.Class getDataType(java.lang.String columnName, int sqlType)
SQLDataHandler
getDataType
in interface SQLDataHandler
columnName
- the name of data field / columnsqlType
- the field's sql data type, one of the constants
in the Types
class.
SQLDataHandler.getDataType(java.lang.String, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |