/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param bindValues * @return */ public static ResultSet execute(Session session, PreparedStatement stm, Object... bindValues) { return execute(session, stm, (ConsistencyLevel) null, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param cql * @param bindValues * @return */ public static ResultSet execute(Session session, String cql, Object... bindValues) { return execute(session, cql, (ConsistencyLevel) null, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param cql * @param bindValues * @return * @since 0.3.0 */ public static ResultSet execute(Session session, String cql, Map<String, Object> bindValues) { return execute(session, cql, (ConsistencyLevel) null, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @return * @since 0.4.0.2 */ public static ResultSet execute(Session session, Statement stm) { return execute(session, stm, null); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param bindValues * @return * @since 0.3.0 */ public static ResultSet execute(Session session, PreparedStatement stm, Map<String, Object> bindValues) { return execute(session, stm, (ConsistencyLevel) null, bindValues); }
private boolean _setValue(Session session, String namespace, long newValue, long currentValue) { ResultSet result; if (currentValue < 0) { result = CqlUtils.execute(session, stmInsertNew, consistencyLevelSetValue, namespace, newValue); } else { result = CqlUtils.execute(session, stmUpdateExisting, consistencyLevelSetValue, newValue, namespace, currentValue); } return result != null ? result.wasApplied() : false; }
/** * Execute update statement. * * @param session * @param pstm * @param params * @return */ public ResultSet update(Session session, PreparedStatement pstm, Object... params) { return CqlUtils.execute(session, pstm, getConsistencyLevelWrite(), params); }
/** * Fetch rows. * * @param session * @param pstm * @param params * @return */ public ResultSet select(Session session, PreparedStatement pstm, Object... params) { return CqlUtils.execute(session, pstm, getConsistencyLevelRead(), params); }
/** * Execute batches of statements. * * @param session * @param consistencyLevel * @param batchType * @param statements * @return * @since 0.3.1 */ public static ResultSet executeBatch(Session session, ConsistencyLevel consistencyLevel, BatchStatement.Type batchType, Statement... statements) { return execute(session, buildBatch(batchType, statements), consistencyLevel); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param stm * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(PreparedStatement stm, Object... bindValues) { return CqlUtils.execute(getSession(), stm, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param stm * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(PreparedStatement stm, Map<String, Object> bindValues) { return CqlUtils.execute(getSession(), stm, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param cql * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(String cql, Object... bindValues) { return CqlUtils.execute(getSession(), cql, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param cql * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(String cql, Map<String, Object> bindValues) { return CqlUtils.execute(getSession(), cql, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(String cql, ConsistencyLevel consistencyLevel, Map<String, Object> bindValues) { return CqlUtils.execute(getSession(), cql, consistencyLevel, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param stm * @param consistencyLevel * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(PreparedStatement stm, ConsistencyLevel consistencyLevel, Object... bindValues) { return CqlUtils.execute(getSession(), stm, consistencyLevel, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(String cql, ConsistencyLevel consistencyLevel, Object... bindValues) { return CqlUtils.execute(getSession(), cql, consistencyLevel, bindValues); }
private boolean _setValue(Session session, String namespace, long newValue, boolean ignoreTimeout) { try { ResultSet result; result = CqlUtils.execute(session, stmSetExisting, consistencyLevelSetValue, newValue, namespace); if (result == null || !result.wasApplied()) { result = CqlUtils.execute(session, stmInsertNew, consistencyLevelSetValue, namespace, newValue); } return result != null ? result.wasApplied() : false; } catch (QueryConsistencyException e) { if (ignoreTimeout) { return false; } else { throw e; } } }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * <p> * The default session (obtained via {@link #getSession()} is used to execute the query. * </p> * * @param stm * @param consistencyLevel * @param bindValues * @return * @since 0.4.0 */ public ResultSet execute(PreparedStatement stm, ConsistencyLevel consistencyLevel, Map<String, Object> bindValues) { return CqlUtils.execute(getSession(), stm, consistencyLevel, bindValues); }