@Override public void set(PreparedStatement prep, int parameterIndex) throws SQLException { prep.setShort(parameterIndex, value); }
@Override public void writeShort(PreparedStatement statement, int index, short value) throws SQLException { statement.setShort(index, value); } }
@Override public void setShort(int parameterIndex, short x) throws SQLException { rawStatement.setShort(parameterIndex, x); }
@Override public void setShort(int parameterIndex, short x) throws SQLException { rawStatement.setShort(parameterIndex, x); }
@Override public void setShort(int parameterIndex, short x) throws SQLException { statement.setShort(parameterIndex, x); }
/** {@inheritDoc} */ @Override public void setShort(int parameterIndex, short x) throws SQLException { delegate.setShort(parameterIndex, x); }
/** * {@inheritDoc} */ @Override public void set(final PreparedStatement st, final int index, final Short value, final int dbSqlType) throws SQLException { st.setShort(index, value.shortValue()); }
/** * Add an exception statement either as a batch or execute immediately if * batch updates are not supported. */ void updateExceptionStatement(PreparedStatement exceptionStatement, String txt, short i, long eventId) throws SQLException { exceptionStatement.setLong(1, eventId); exceptionStatement.setShort(2, i); exceptionStatement.setString(3, txt); if (cnxSupportsBatchUpdates) { exceptionStatement.addBatch(); } else { exceptionStatement.execute(); } }
@Override public final void setShort(final int parameterIndex, final short x) throws SQLException { getTargetPreparedStatement().setShort(parameterIndex, x); }
@Override public void setShort(int parameterIndex, short x) throws SQLException { setParamByIndex(parameterIndex, x); targetStatement.setShort(parameterIndex, x); }
@Override protected void doBind(PreparedStatement st, X value, int index, WrapperOptions options) throws SQLException { st.setShort( index, javaTypeDescriptor.unwrap( value, Short.class, options ) ); }
@Override public void setShort(int parameterIndex, short x) throws SQLException { SQLException e = null; try { delegate.setShort(parameterIndex, x); } catch (SQLException sqle) { e = sqle; throw e; } finally { eventListener.onAfterPreparedStatementSet(statementInformation, parameterIndex, x, e); } }
@Override public void setShort(int parameterIndex, short x) throws SQLException { checkOpen(); try { stmt.setShort(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.SMALLINT); } else { short v; if (obj instanceof Number) v = ((Number) obj).shortValue(); else v = Castors.me().castTo(obj.toString(), short.class); stat.setShort(i, v); } } };
void bindLoggingEventWithInsertStatement(PreparedStatement stmt, ILoggingEvent event) throws SQLException { stmt.setLong(TIMESTMP_INDEX, event.getTimeStamp()); stmt.setString(FORMATTED_MESSAGE_INDEX, event.getFormattedMessage()); stmt.setString(LOGGER_NAME_INDEX, event.getLoggerName()); stmt.setString(LEVEL_STRING_INDEX, event.getLevel().toString()); stmt.setString(THREAD_NAME_INDEX, event.getThreadName()); stmt.setShort(REFERENCE_FLAG_INDEX, DBHelper.computeReferenceMask(event)); }
@Override public void preparedStatement_setShort(PreparedStatementProxy statement, int parameterIndex, short x) throws SQLException { if (this.pos < filterSize) { nextFilter().preparedStatement_setShort(this, statement, parameterIndex, x); return; } statement.getRawObject().setShort(parameterIndex, x); }
public Q setShort(final int index, final short value) { initPrepared(); try { preparedStatement.setShort(index, value); } catch (SQLException sex) { throwSetParamError(index, sex); } return _this(); }
public Q setShort(final String param, final short value) { initPrepared(); final int[] positions = query.getNamedParameterIndices(param); try { for (final int position : positions) { final int index = position; preparedStatement.setShort(index, value); } } catch (SQLException sex) { throwSetParamError(param, sex); } return _this(); }
@Test public void testWaffleShort() throws Exception { ctx.findArgumentFor(Object.class, (short) 2000).get().apply(2, stmt, null); verify(stmt).setShort(2, (short) 2000); }
@Test public void testConvertSmallint() throws SQLException { assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setShort(i, (short) 123)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, (short) 123)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, (byte) 123, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, (short) 123, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, 123, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, 123L, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, 123.9f, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, 123.9d, Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, BigInteger.valueOf(123), Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123), Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, BigDecimal.valueOf(123.9), Types.SMALLINT)); assertParameter((short) 123, Types.SMALLINT, (ps, i) -> ps.setObject(i, "123", Types.SMALLINT)); assertParameter((short) 1, Types.SMALLINT, (ps, i) -> ps.setObject(i, true, Types.SMALLINT)); assertParameter((short) 0, Types.SMALLINT, (ps, i) -> ps.setObject(i, false, Types.SMALLINT)); }