/** * Set the value for a parameter. The method used is based on the SQL type * of the parameter and we can handle complex types like arrays and LOBs. * @param ps the prepared statement or callable statement * @param paramIndex index of the parameter we are setting * @param param the parameter as it is declared including type * @param inValue the value to set * @throws SQLException if thrown by PreparedStatement methods */ public static void setParameterValue(PreparedStatement ps, int paramIndex, SqlParameter param, @Nullable Object inValue) throws SQLException { setParameterValueInternal(ps, paramIndex, param.getSqlType(), param.getTypeName(), param.getScale(), inValue); }
assertEquals("description", parameter4.getName()); assertNull("Expect that the scale is null.", parameter1.getScale()); assertNull("Expect that the scale is null.", parameter2.getScale()); assertEquals("Expect that the scale is 5.", Integer.valueOf(5), parameter3.getScale()); assertNull("Expect that the scale is null.", parameter4.getScale());
assertEquals("description", parameter4.getName()); assertNull("Expect that the scale is null.", parameter1.getScale()); assertNull("Expect that the scale is null.", parameter2.getScale()); assertEquals("Expect that the scale is 5.", Integer.valueOf(5), parameter3.getScale()); assertNull("Expect that the scale is null.", parameter4.getScale());
assertEquals("description", parameter4.getName()); assertNull("Expect that the scale is null.", parameter1.getScale()); assertNull("Expect that the scale is null.", parameter2.getScale()); assertEquals("Expect that the scale is 5.", Integer.valueOf(5), parameter3.getScale()); assertNull("Expect that the scale is null.", parameter4.getScale());
/** * Set the value for a parameter. The method used is based on the SQL type * of the parameter and we can handle complex types like arrays and LOBs. * @param ps the prepared statement or callable statement * @param paramIndex index of the parameter we are setting * @param param the parameter as it is declared including type * @param inValue the value to set * @throws SQLException if thrown by PreparedStatement methods */ public static void setParameterValue( PreparedStatement ps, int paramIndex, SqlParameter param, Object inValue) throws SQLException { setParameterValueInternal(ps, paramIndex, param.getSqlType(), param.getTypeName(), param.getScale(), inValue); }
@Nullable Object inValue) throws SQLException { setParameterValueInternal(ps, paramIndex, param.getSqlType(), param.getTypeName(), param.getScale(), inValue);