prefuse.data.io.sql
Interface SQLDataHandler

All Known Implementing Classes:
CompositeSQLDataHandler, DefaultSQLDataHandler

public interface SQLDataHandler

Interface for taking a value in a SQL ResultSet and translating it into a Java data value for use in a prefuse Table.

Author:
jeffrey heer

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.
 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.
 

Method Detail

process

void process(Table t,
             int trow,
             java.sql.ResultSet rset,
             int rcol)
             throws java.sql.SQLException
Process a data value from a ResultSet, translating it into a Java data value and storing it in a Table.

Parameters:
t - the Table in which to store the result value
trow - the Table row to add to
rset - the ResultSet to read the SQL value from, assumed to be set to the desired row
rcol - 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.
Throws:
java.sql.SQLException - if an error occurs accessing the ResultSet

getDataType

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.

Parameters:
columnName - the name of data field / column
sqlType - the field's sql data type, one of the constants in the Types class.
Returns:
the Java Class data type


Copyright © 2007 Regents of the University of California