Code example for PreparedStatement

Methods: setLong, setString

0
        super(storageEntities);
    } 
 
    @Override 
    protected void setValues(final PreparedStatement ps, final StorageEntity element) throws SQLException {
        ps.setString(1, element.getEntity().toString());
        ps.setString(2, element.getHash());
        ps.setLong(3, element.getTypeId());
        ps.setLong(4, element.getId());
    } 
 
    public static EntityBatchPreparedStatementSetter of(final Iterable<StorageEntity> storageEntities) {
        return new EntityBatchPreparedStatementSetter(storageEntities);
    } 
}