@Override public void set(PreparedStatement prep, int parameterIndex) throws SQLException { prep.setByte(parameterIndex, value); }
statement.setByte(parameter, SignedBytes.checkedCast(type.getLong(block, position)));
@Override public void writeByte(PreparedStatement statement, int index, byte value) throws SQLException { statement.setByte(index, value); } }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { rawStatement.setByte(parameterIndex, x); }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { statement.setByte(parameterIndex, x); }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { rawStatement.setByte(parameterIndex, x); }
/** {@inheritDoc} */ @Override public void setByte(int parameterIndex, byte x) throws SQLException { delegate.setByte(parameterIndex, x); }
public void setByte(int parameterIndex, byte x) throws SQLException { pstmt.setByte(parameterIndex, x); }
@Override public void set(PreparedStatement prep, int parameterIndex) throws SQLException { prep.setByte(parameterIndex, value); }
/** * {@inheritDoc} */ @Override public void set(final PreparedStatement st, final int index, final Byte value, final int dbSqlType) throws SQLException { st.setByte(index, value.byteValue()); } }
@Override public final void setByte(final int parameterIndex, final byte x) throws SQLException { getTargetPreparedStatement().setByte(parameterIndex, x); }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { setParamByIndex(parameterIndex, x); targetStatement.setByte(parameterIndex, x); }
@Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { st.setByte( index, javaTypeDescriptor.unwrap( value, Byte.class, options ) ); }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { SQLException e = null; try { delegate.setByte(parameterIndex, x); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterPreparedStatementSet(statementInformation, parameterIndex, x, e); } }
@Override public void setByte(int parameterIndex, byte x) throws SQLException { checkOpen(); try { stmt.setByte(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.TINYINT); } else { byte v; if (obj instanceof Number) v = ((Number) obj).byteValue(); else v = Castors.me().castTo(obj.toString(), byte.class); stat.setByte(i, v); } } };
@Override public void preparedStatement_setByte(PreparedStatementProxy statement, int parameterIndex, byte x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setByte(this, statement, parameterIndex, x); return; } statement.getRawObject().setByte(parameterIndex, x); }
public Q setByte(final int index, final byte value) { initPrepared(); try { preparedStatement.setByte(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
public Q setByte(final String param, final byte value) { initPrepared(); final int[] positions = query.getNamedParameterIndices(param); try { for (final int position : positions) { preparedStatement.setByte(position, value); } } catch (SQLException sex) { throwSetParamError(param, sex); } return _this(); }
@Test public void testConvertTinyint() throws SQLException { assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setByte(i, (byte) 123)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, (byte) 123)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, (byte) 123, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, (short) 123, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, 123, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, 123L, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, 123.9f, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, 123.9d, Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, BigInteger.valueOf(123), Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123), Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123.9), Types.TINYINT)); assertParameter((byte) 123, Types.TINYINT, (ps, i) -> ps.setObject(i, "123", Types.TINYINT)); assertParameter((byte) 1, Types.TINYINT, (ps, i) -> ps.setObject(i, true, Types.TINYINT)); assertParameter((byte) 0, Types.TINYINT, (ps, i) -> ps.setObject(i, false, Types.TINYINT)); }