Code example for ResultSet

Methods: getBoolean, wasNull

0
 * 所以,只好把类型设成 INTEGER了 
 */ 
public class OracleBooleanAdaptor implements ValueAdaptor { 
 
	public Object get(ResultSet rs, String colName) throws SQLException {
		boolean re = rs.getBoolean(colName);
		return rs.wasNull() ? null : re;
	} 
 
	public void set(PreparedStatement stat, Object obj, int i) throws SQLException {
		if (null == obj) {
			stat.setNull(i, Types.INTEGER);
		} else { 
			boolean v;
			if (obj instanceof Boolean)
				v = (Boolean) obj;
			else if (obj instanceof Number)
				v = ((Number) obj).intValue() > 0;
			else if (obj instanceof Character)
				v = Character.toUpperCase((Character) obj) == 'T';
			else