/** * Executes a call of this procedure in the specified context and with the specified call * bindings. The semantics of what the procedure actually does, is up to each implementation. Note * that the call bindings are normally inherited from the procedure bindings with arguments bound * to their call values. * * @param cx the procedure call context * @param bindings the call bindings to use * @return the result of the call, or null if the call produced no result * @throws ProcedureException if the call execution caused an error */ public Object call(CallContext cx, Bindings bindings) throws ProcedureException { JdbcChannel channel = JdbcProcedure.connectionReserve(cx, bindings); String sql = (String) bindings.getValue(JdbcProcedure.BINDING_SQL); try { return channel.executeStatement(sql); } catch (ConnectionException e) { throw new ProcedureException(e.getMessage()); } }
/** * Creates a new JDBC SQL statement procedure. * * @throws ProcedureException if the initialization failed */ public JdbcBuiltInStatementProcedure() throws ProcedureException { defaults.set( JdbcProcedure.BINDING_DB, Bindings.ARGUMENT, "", "The JDBC connection identifier."); defaults.set(JdbcProcedure.BINDING_SQL, Bindings.ARGUMENT, "", "The SQL statement string."); this.defaults.seal(); }