List of usage examples for java.sql ResultSet wasNull
boolean wasNull() throws SQLException;
NULL
. From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswMySql.CFFswMySqlSchema.java
public static Short getNullableInt16(ResultSet reader, int colidx) { try {//from w w w . ja v a 2s.co m short val = reader.getShort(colidx); if (reader.wasNull()) { return (null); } else { return (new Short(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFFswMySqlSchema.class, "getNullableInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccPgSql.CFAccPgSqlSchema.java
public static BigDecimal getNullableUInt64(ResultSet reader, int colidx) { try {/* w w w .j ava 2 s. c o m*/ String strval = reader.getString(colidx); if (reader.wasNull() || (strval == null) || (strval.length() <= 0)) { return (null); } else { BigDecimal retval = new BigDecimal(strval); return (retval); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAccPgSqlSchema.class, "getNullableUInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMSSql.CFEnSyntaxMSSqlSchema.java
public static Short getNullableInt16(ResultSet reader, int colidx) { try {// w w w . j av a 2s . c o m short val = reader.getShort(colidx); if (reader.wasNull()) { return (null); } else { return (new Short(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFEnSyntaxMSSqlSchema.class, "getNullableInt64", e); } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswMySql.CFFswMySqlSchema.java
public static String getNullableString(ResultSet reader, int colidx) { try {//from www . ja v a 2 s. c o m String val = reader.getString(colidx); if (reader.wasNull()) { return (null); } else { return (val); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFFswMySqlSchema.class, "getNullableString", e); } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMSSql.CFEnSyntaxMSSqlSchema.java
public static String getNullableString(ResultSet reader, int colidx) { try {//from ww w . j a v a 2s. c o m String val = reader.getString(colidx); if (reader.wasNull()) { return (null); } else { return (val); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFEnSyntaxMSSqlSchema.class, "getNullableString", e); } }
From source file:net.sourceforge.msscodefactory.cffreeswitch.v2_1.CFFswMySql.CFFswMySqlSchema.java
public static BigDecimal getNullableUInt64(ResultSet reader, int colidx) { try {/*from ww w .jav a 2 s . c o m*/ String strval = reader.getString(colidx); if (reader.wasNull() || (strval == null) || (strval.length() <= 0)) { return (null); } else { BigDecimal retval = new BigDecimal(strval); return (retval); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFFswMySqlSchema.class, "getNullableUInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfensyntax.v2_2.CFEnSyntaxMSSql.CFEnSyntaxMSSqlSchema.java
public static BigDecimal getNullableUInt64(ResultSet reader, int colidx) { try {/* w ww .j av a2s . c om*/ String strval = reader.getString(colidx); if (reader.wasNull() || (strval == null) || (strval.length() <= 0)) { return (null); } else { BigDecimal retval = new BigDecimal(strval); return (retval); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFEnSyntaxMSSqlSchema.class, "getNullableUInt64", e); } }
From source file:edu.ku.brc.specify.toycode.mexconabio.BuildFromRecovery.java
/** * @param stmt/*w ww. j ava2 s . co m*/ * @param first * @param last * @return */ private Integer getAgentId(final PreparedStatement stmt, final String first, final String last) { Integer id = null; ResultSet rs = null; try { stmt.setString(1, first == null ? null : first.toLowerCase()); stmt.setString(2, last == null ? null : last.toLowerCase()); rs = stmt.executeQuery(); if (rs.next()) { id = rs.getInt(1); if (rs.wasNull()) id = null; } } catch (Exception ex) { ex.printStackTrace(); } finally { try { if (rs != null) rs.close(); } catch (Exception ex) { } } return id; }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java
public static Integer getNullableInt32(ResultSet reader, int colidx) { try {//from w ww.j ava 2 s. co m int val = reader.getInt(colidx); if (reader.wasNull()) { return (null); } else { return (new Integer(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAccDb2LUWSchema.class, "getNullableInt32", e); } }
From source file:net.sourceforge.msscodefactory.cfacc.v2_0.CFAccDb2LUW.CFAccDb2LUWSchema.java
public static Integer getNullableUInt16(ResultSet reader, int colidx) { try {/*from w w w .j av a2 s. c om*/ int val = reader.getInt(colidx); if (reader.wasNull()) { return (null); } else { return (new Integer(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAccDb2LUWSchema.class, "getNullableUInt16", e); } }