public QueryPlan compileQuery(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); return compileQuery(stmt, sql); }
public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
@Override public ResultSet executeQuery(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute query: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { throw new ExecuteQueryNotApplicableException(sql); } return executeQuery(stmt,createQueryLogger(stmt,sql)); }
@Override public int executeUpdate(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (!stmt.getOperation().isMutation) { throw new ExecuteUpdateNotApplicableException(sql); } if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } int updateCount = executeMutation(stmt); flushIfNecessary(); return updateCount; }
@Override public MutationPlan compilePlan(PhoenixStatement stmt, Sequence.ValueOp seqAction) throws SQLException { ExecutableSelectStatement wrappedSelect = new ExecutableSelectStatement( (ExecutableSelectStatement) stmt.parseStatement(this.getQuerySQL())); DeclareCursorCompiler compiler = new DeclareCursorCompiler(stmt, this.getOperation(),wrappedSelect.compilePlan(stmt, seqAction)); return compiler.compile(this); } }
@Override public boolean execute(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } executeMutation(stmt); flushIfNecessary(); return false; } executeQuery(stmt,createQueryLogger(stmt,sql)); return true; }
public QueryPlan compileQuery(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); return compileQuery(stmt, sql); }
public QueryPlan compileQuery(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); return compileQuery(stmt, sql); }
public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
public MutationPlan compileMutation(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute update: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); return compileMutation(stmt, sql); }
@Override public ResultSet executeQuery(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute query: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { throw new ExecuteQueryNotApplicableException(sql); } return executeQuery(stmt,createQueryLogger(stmt,sql)); }
@Override public ResultSet executeQuery(String sql) throws SQLException { if (logger.isDebugEnabled()) { logger.debug(LogUtil.addCustomAnnotations("Execute query: " + sql, connection)); } CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { throw new ExecuteQueryNotApplicableException(sql); } return executeQuery(stmt,createQueryLogger(stmt,sql)); }
@Override public int executeUpdate(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (!stmt.getOperation().isMutation) { throw new ExecuteUpdateNotApplicableException(sql); } if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } int updateCount = executeMutation(stmt); flushIfNecessary(); return updateCount; }
@Override public int executeUpdate(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (!stmt.getOperation().isMutation) { throw new ExecuteUpdateNotApplicableException(sql); } if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } int updateCount = executeMutation(stmt); flushIfNecessary(); return updateCount; }
@Override public MutationPlan compilePlan(PhoenixStatement stmt, Sequence.ValueOp seqAction) throws SQLException { ExecutableSelectStatement wrappedSelect = new ExecutableSelectStatement( (ExecutableSelectStatement) stmt.parseStatement(this.getQuerySQL())); DeclareCursorCompiler compiler = new DeclareCursorCompiler(stmt, this.getOperation(),wrappedSelect.compilePlan(stmt, seqAction)); return compiler.compile(this); } }
@Override public MutationPlan compilePlan(PhoenixStatement stmt, Sequence.ValueOp seqAction) throws SQLException { ExecutableSelectStatement wrappedSelect = new ExecutableSelectStatement( (ExecutableSelectStatement) stmt.parseStatement(this.getQuerySQL())); DeclareCursorCompiler compiler = new DeclareCursorCompiler(stmt, this.getOperation(),wrappedSelect.compilePlan(stmt, seqAction)); return compiler.compile(this); } }
@Override public boolean execute(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } executeMutation(stmt); flushIfNecessary(); return false; } executeQuery(stmt,createQueryLogger(stmt,sql)); return true; }
@Override public boolean execute(String sql) throws SQLException { CompilableStatement stmt = parseStatement(sql); if (stmt.getOperation().isMutation()) { if (!batch.isEmpty()) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.EXECUTE_UPDATE_WITH_NON_EMPTY_BATCH) .build().buildException(); } executeMutation(stmt); flushIfNecessary(); return false; } executeQuery(stmt,createQueryLogger(stmt,sql)); return true; }