static Value read(TestSynth config,ResultSet rs,int index) throws SQLException {
  ResultSetMetaData meta=rs.getMetaData();
  Object data;
  int type=meta.getColumnType(index);
switch (type) {
case Types.REAL:
case Types.DOUBLE:
    data=rs.getDouble(index);
  break;
case Types.BIGINT:
data=rs.getLong(index);
break;
case Types.DECIMAL:
case Types.NUMERIC:
data=rs.getBigDecimal(index);
break;
case Types.BLOB:
case Types.BINARY:
case Types.VARBINARY:
case Types.LONGVARBINARY:
data=rs.getBytes(index);
break;
case Types.OTHER:
case Types.CLOB:
case Types.VARCHAR:
case Types.LONGVARCHAR:
case Types.CHAR:
data=rs.getString(index);
break;
case Types.DATE:
data=rs.getDate(index);
break;
case Types.TIME:
data=rs.getTime(index);
break;
case Types.TIMESTAMP:
data=rs.getTimestamp(index);
break;
case Types.INTEGER:
data=rs.getInt(index);
break;
case Types.NULL:
data=null;
break;
case Types.BOOLEAN:
case Types.BIT:
data=rs.getBoolean(index) ? "TRUE" : "FALSE";
break;
default :
throw new AssertionError("type=" + type);
}
if (rs.wasNull()) {
data=null;
}
return new Value(config,type,data);
}

static Value read ( TestSynth config , ResultSet rs , int index ) throws SQLException { ResultSetMetaData meta = rs . getMetaData ( ) ; Object data ; int type = meta . getColumnType ( index ) ; switch ( type ) { case Types . REAL : case Types . DOUBLE : data = rs . getDouble ( index ) ; break ; case Types . BIGINT : data = rs . getLong ( index ) ; break ; case Types . DECIMAL : case Types . NUMERIC : data = rs . getBigDecimal ( index ) ; break ; case Types . BLOB : case Types . BINARY : case Types . VARBINARY : case Types . LONGVARBINARY : data = rs . getBytes ( index ) ; break ; case Types . OTHER : case Types . CLOB : case Types . VARCHAR : case Types . LONGVARCHAR : case Types . CHAR : data = rs . getString ( index ) ; break ; case Types . DATE : data = rs . getDate ( index ) ; break ; case Types . TIME : data = rs . getTime ( index ) ; break ; case Types . TIMESTAMP : data = rs . getTimestamp ( index ) ; break ; case Types . INTEGER : data = rs . getInt ( index ) ; break ; case Types . NULL : data = null ; break ; case Types . BOOLEAN : case Types . BIT : data = rs . getBoolean ( index ) ? "TRUE" : "FALSE" ; break ; default : throw new AssertionError ( "type=" + type ) ; } if ( rs . wasNull ( ) ) { data = null ; } return new Value ( config , type , data ) ; }
read a value from a result set .
