List of usage examples for java.sql CallableStatement setNull
void setNull(String parameterName, int sqlType, String typeName) throws SQLException;
NULL
. From source file:org.seasar.dbflute.logic.sql2entity.cmentity.DfProcedureExecutionMetaExtractor.java
protected void bindObject(Connection conn, CallableStatement cs, int paramIndex, int jdbcDefType, Object value, DfProcedureColumnMeta column) throws SQLException { final ValueType valueType; {// www .j a v a 2 s . c o m final ValueType forcedType = getForcedValueType(column); if (forcedType != null) { valueType = forcedType; } else { valueType = TnValueTypes.findByValueOrJdbcDefType(value, jdbcDefType); } } try { if (column.isOracleTreatedAsArray() && column.hasTypeArrayInfo()) { cs.setNull(paramIndex, Types.ARRAY, column.getTypeArrayInfo().getTypeSqlName()); } else if (column.isOracleStruct() && column.hasTypeStructInfo()) { cs.setNull(paramIndex, Types.STRUCT, column.getTypeStructInfo().getTypeSqlName()); } else { valueType.bindValue(conn, cs, paramIndex, value); } } catch (SQLException e) { String msg = buildBindingExceptionMessage(paramIndex, jdbcDefType, value, column, valueType); throw new DfJDBCException(msg, e); } catch (RuntimeException e) { String msg = buildBindingExceptionMessage(paramIndex, jdbcDefType, value, column, valueType); throw new IllegalStateException(msg, e); } }