List of usage examples for java.sql ResultSet wasNull
boolean wasNull() throws SQLException;
NULL
. From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlSchema.java
public static Long getNullableUInt32(ResultSet reader, int colidx) { try {//from www. j a v a 2 s .com long val = reader.getLong(colidx); if (reader.wasNull()) { return (null); } else { return (new Long(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstPgSqlSchema.class, "getNullableUInt32", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlSchema.java
public static Byte getNullableByte(ResultSet reader, int colidx) { try {/*from ww w . jav a 2 s . c o m*/ byte val = reader.getByte(colidx); if (reader.wasNull()) { return (null); } else { return (new Byte(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstPgSqlSchema.class, "getNullableByte", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlSchema.java
public static Short getNullableInt16(ResultSet reader, int colidx) { try {//from w ww. j a v 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(CFAstPgSqlSchema.class, "getNullableInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlSchema.java
public static String getNullableString(ResultSet reader, int colidx) { try {//from w w w . ja va 2 s . com String val = reader.getString(colidx); if (reader.wasNull()) { return (null); } else { return (val); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstPgSqlSchema.class, "getNullableString", e); } }
From source file:com.splicemachine.derby.impl.load.HdfsUnsafeImportIT.java
private void testImport(String schemaName, String tableName, String location, String colList, long badRecordsAllowed) throws Exception { PreparedStatement ps = methodWatcher .prepareStatement(format("call SYSCS_UTIL.IMPORT_DATA_UNSAFE(" + "'%s'," + // schema name "'%s'," + // table name "'%s'," + // insert column list "'%s'," + // file path "','," + // column delimiter "null," + // character delimiter "null," + // timestamp format "null," + // date format "null," + // time format "%d," + // max bad records "'%s'," + // bad record dir "null," + // has one line records "null)", // char set schemaName, tableName, colList, location, badRecordsAllowed, BADDIR.getCanonicalPath())); ps.execute();// w ww. ja v a 2s.com ResultSet rs = methodWatcher.executeQuery(format("select * from %s.%s", schemaName, tableName)); List<String> results = Lists.newArrayList(); while (rs.next()) { String name = rs.getString(1); String title = rs.getString(2); int age = rs.getInt(3); Assert.assertTrue("age was null!", !rs.wasNull()); assertNotNull("Name is null!", name); assertNotNull("Title is null!", title); assertNotNull("Age is null!", age); results.add(String.format("name:%s,title:%s,age:%d", name, title, age)); } Assert.assertTrue("no rows imported!", results.size() > 0); }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstPgSql.CFAstPgSqlSchema.java
public static BigDecimal getNullableUInt64(ResultSet reader, int colidx) { try {/*from w ww . 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(CFAstPgSqlSchema.class, "getNullableUInt64", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstDb2LUW.CFAstDb2LUWSchema.java
public static Integer getNullableInt32(ResultSet reader, int colidx) { try {/* w w w .j ava2 s. com*/ int val = reader.getInt(colidx); if (reader.wasNull()) { return (null); } else { return (new Integer(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstDb2LUWSchema.class, "getNullableInt32", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstDb2LUW.CFAstDb2LUWSchema.java
public static Integer getNullableUInt16(ResultSet reader, int colidx) { try {/* w w w . ja v a 2 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(CFAstDb2LUWSchema.class, "getNullableUInt16", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstDb2LUW.CFAstDb2LUWSchema.java
public static Byte getNullableByte(ResultSet reader, int colidx) { try {//from w ww . j a v a 2 s . c om byte val = reader.getByte(colidx); if (reader.wasNull()) { return (null); } else { return (new Byte(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstDb2LUWSchema.class, "getNullableByte", e); } }
From source file:net.sourceforge.msscodefactory.cfasterisk.v2_0.CFAstDb2LUW.CFAstDb2LUWSchema.java
public static Long getNullableUInt32(ResultSet reader, int colidx) { try {/*from w w w .java 2 s . c o m*/ long val = reader.getLong(colidx); if (reader.wasNull()) { return (null); } else { return (new Long(val)); } } catch (SQLException e) { throw CFLib.getDefaultExceptionFactory().newDbException(CFAstDb2LUWSchema.class, "getNullableUInt32", e); } }