commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pi...@ais.pl (Tomasz Pik)
Subject Re: [jdbc] JdbcUtil etc
Date Fri, 08 Nov 2002 23:05:55 GMT
> 5) 

public static Long readLong(ResultSet rs, int index) throws SQLException {
  Long result = new Long(rs.getLong(index));
  if (rs.wasNull()) {
    return null;
  } else {
    return result;
  }
}

public static void setLong(PreparedStatement pstmt, int index, Long value) throws SQLException
{
  if (value == null) {
    pstmt.setNull(index,  Types.NUMBER);
  } else {
    pstmt.setLong(index, value.longValue();
  }
}

And similar methods for the rest of supported types?

Regards
Tomek Pik
pikus@ais.pl

> Hen

--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message