@Override public void set(PreparedStatement prep, int parameterIndex) throws SQLException { prep.setFloat(parameterIndex, value); }
@Override public void writeFloat(PreparedStatement statement, int index, float value) throws SQLException { statement.setFloat(index, value); } }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { rawStatement.setFloat(parameterIndex, x); }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { statement.setFloat(parameterIndex, x); }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { rawStatement.setFloat(parameterIndex, x); }
/** {@inheritDoc} */ @Override public void setFloat(int parameterIndex, float x) throws SQLException { delegate.setFloat(parameterIndex, x); }
public void setFloat(int parameterIndex, float x) throws SQLException { pstmt.setFloat(parameterIndex, x); }
@Override public void set(PreparedStatement prep, int parameterIndex) throws SQLException { prep.setFloat(parameterIndex, value); }
/** * {@inheritDoc} */ @Override public void set(final PreparedStatement st, final int index, final Float value, final int dbSqlType) throws SQLException { st.setFloat(index, value.floatValue()); }
@Override public final void setFloat(final int parameterIndex, final float x) throws SQLException { getTargetPreparedStatement().setFloat(parameterIndex, x); }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { setParamByIndex(parameterIndex, x); targetStatement.setFloat(parameterIndex, x); }
@Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { st.setFloat( index, javaTypeDescriptor.unwrap( value, Float.class, options ) ); }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { SQLException e = null; try { delegate.setFloat(parameterIndex, x); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterPreparedStatementSet(statementInformation, parameterIndex, x, e); } }
@Override public void setFloat(int parameterIndex, float x) throws SQLException { checkOpen(); try { stmt.setFloat(parameterIndex, x); } catch (Throwable t) { throw checkException(t); } }
public void set(PreparedStatement stat, Object obj, int i) throws SQLException { if (null == obj) { stat.setNull(i, Types.FLOAT); } else { float v; if (obj instanceof Number) v = ((Number) obj).floatValue(); else v = Castors.me().castTo(obj.toString(), float.class); stat.setFloat(i, v); } } };
@Override public void preparedStatement_setFloat(PreparedStatementProxy statement, int parameterIndex, float x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setFloat(this, statement, parameterIndex, x); return; } statement.getRawObject().setFloat(parameterIndex, x); }
public Q setFloat(final int index, final float value) { initPrepared(); try { preparedStatement.setFloat(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
public Q setFloat(final String param, final float value) { initPrepared(); final int[] positions = query.getNamedParameterIndices(param); try { for (final int position : positions) { preparedStatement.setFloat(position, value); } } catch (SQLException sex) { throwSetParamError(param, sex); } return _this(); }
@ParameterizedTest @CsvSource(value = {"45.66, 7", "88.55, 6"}) void call_setFloat(Float value, int targetSqlType) throws SQLException { DbUtil.setPreparedStatementObject(mock, index, value, targetSqlType); Mockito.verify(mock, Mockito.times(1)).setFloat(index, value); }
@Test public void testConvertReal() throws SQLException { assertParameter(4.2f, Types.REAL, (ps, i) -> ps.setFloat(i, 4.2f)); assertParameter(4.2f, Types.REAL, (ps, i) -> ps.setObject(i, 4.2f)); for (int type : asList(Types.REAL, Types.FLOAT)) { assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, (byte) 123, type)); assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, (short) 123, type)); assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, 123, type)); assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, 123L, type)); assertParameter(123.9f, Types.REAL, (ps, i) -> ps.setObject(i, 123.9f, type)); assertParameter(123.9f, Types.REAL, (ps, i) -> ps.setObject(i, 123.9d, type)); assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, BigInteger.valueOf(123), type)); assertParameter(123.0f, Types.REAL, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123), type)); assertParameter(123.9f, Types.REAL, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123.9), type)); assertParameter(4.2f, Types.REAL, (ps, i) -> ps.setObject(i, "4.2", type)); assertParameter(1.0f, Types.REAL, (ps, i) -> ps.setObject(i, true, type)); assertParameter(0.0f, Types.REAL, (ps, i) -> ps.setObject(i, false, type)); } }