/** * 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 just one row. * * @param session * @param stm * @return * @since 0.4.0.2 */ public static Row executeOne(Session session, Statement stm) { return executeOne(session, stm, null); }
/** * Prepare a CQL statement. * * @param session * @param cql * @return */ public PreparedStatement prepareStatement(Session session, String cql) { return CqlUtils.prepareStatement(session, cql); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.2.2 */ public static ResultSet execute(Session session, String cql, ConsistencyLevel consistencyLevel, Object... bindValues) { return _execute(session, prepareStatement(session, cql), consistencyLevel, bindValues); }
/** * 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); }
/** * Async-Executes a SELECT query and returns the {@link ResultSetFuture}. * * @param session * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.3.0 */ public static ResultSetFuture executeAsync(Session session, String cql, ConsistencyLevel consistencyLevel, Map<String, Object> bindValues) { return _executeAsync(session, prepareStatement(session, cql), consistencyLevel, bindValues); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param consistencyLevel * @param bindValues * @return * @since 0.2.6 */ private static ResultSet _execute(Session session, PreparedStatement stm, ConsistencyLevel consistencyLevel, Object... bindValues) { BoundStatement bstm = bindValues(ensurePrepareStatement(session, stm), bindValues); if (consistencyLevel != null) { if (consistencyLevel == ConsistencyLevel.SERIAL || consistencyLevel == ConsistencyLevel.LOCAL_SERIAL) { bstm.setSerialConsistencyLevel(consistencyLevel); } else { bstm.setConsistencyLevel(consistencyLevel); } } return session.execute(bstm); }
/** * Execute batches of statements. * * @param session * @param statements * @return * @since 0.3.1 */ public static ResultSet executeBatch(Session session, Statement... statements) { return executeBatch(session, null, null, statements); }
/** * Bind values to a {@link PreparedStatement}. * * @param stm * @param values * @return * @since 0.4.0 */ public BoundStatement bindValues(PreparedStatement stm, Map<String, Object> values) { return CqlUtils.bindValues(stm, values); }
/** * Execute a SELECT query and returns just one row. * * @param session * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.2.2 */ public static Row executeOne(Session session, String cql, ConsistencyLevel consistencyLevel, Object... bindValues) { return _executeOne(session, prepareStatement(session, cql), consistencyLevel, bindValues); }
/** * Async-Execute batches of statements. * * @param session * @param consistencyLevel * @param batchType * @param statements * @return * @since 0.3.1 */ public static ResultSetFuture executeBatchAsync(Session session, ConsistencyLevel consistencyLevel, BatchStatement.Type batchType, Statement... statements) { return executeAsync(session, buildBatch(batchType, statements), consistencyLevel); } }
/** * Build batch statement. * * @param statements * @return * @since 0.3.1 */ public static BatchStatement buildBatch(Statement... statements) { return buildBatch(null, statements); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param consistencyLevel * @return * @since 0.4.0.2 */ public static ResultSet execute(Session session, Statement stm, ConsistencyLevel consistencyLevel) { return _execute(session, stm, consistencyLevel); }
/** * Async-Executes a SELECT query and returns the {@link ResultSetFuture}. * * @param session * @param stm * @param consistencyLevel * @return * @since 0.4.0.2 */ public static ResultSetFuture executeAsync(Session session, Statement stm, ConsistencyLevel consistencyLevel) { return _executeAsync(session, stm, consistencyLevel); }
/** * Execute a SELECT query and returns just one row. * * @param session * @param stm * @param consistencyLevel * @return * @since 0.4.0.2 */ public static Row executeOne(Session session, Statement stm, ConsistencyLevel consistencyLevel) { return _executeOne(session, stm, consistencyLevel); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param stm * @param consistencyLevel * @param bindValues * @return * @since 0.3.0 */ private static ResultSet _execute(Session session, PreparedStatement stm, ConsistencyLevel consistencyLevel, Map<String, Object> bindValues) { BoundStatement bstm = bindValues(ensurePrepareStatement(session, stm), bindValues); if (consistencyLevel != null) { if (consistencyLevel == ConsistencyLevel.SERIAL || consistencyLevel == ConsistencyLevel.LOCAL_SERIAL) { bstm.setSerialConsistencyLevel(consistencyLevel); } else { bstm.setConsistencyLevel(consistencyLevel); } } return session.execute(bstm); }
/** * Execute batches of statements. * * @param session * @param consistencyLevel * @param statements * @return * @since 0.3.1 */ public static ResultSet executeBatch(Session session, ConsistencyLevel consistencyLevel, Statement... statements) { return executeBatch(session, consistencyLevel, null, statements); }
/** * Bind values to a {@link PreparedStatement}. * * @param stm * @param values * @return * @since 0.4.0 */ public BoundStatement bindValues(PreparedStatement stm, Object... values) { return CqlUtils.bindValues(stm, values); }
/** * Execute a SELECT query and returns the {@link ResultSet}. * * @param session * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.3.0 */ public static ResultSet execute(Session session, String cql, ConsistencyLevel consistencyLevel, Map<String, Object> bindValues) { return _execute(session, prepareStatement(session, cql), consistencyLevel, bindValues); }
/** * Async-Executes a SELECT query and returns the {@link ResultSetFuture}. * * @param session * @param cql * @param consistencyLevel * @param bindValues * @return * @since 0.2.3 */ public static ResultSetFuture executeAsync(Session session, String cql, ConsistencyLevel consistencyLevel, Object... bindValues) { return _executeAsync(session, prepareStatement(session, cql), consistencyLevel, bindValues); }