Return-Path: Delivered-To: apmail-xml-cocoon-dev-archive@xml.apache.org Received: (qmail 55130 invoked by uid 500); 9 Jan 2002 17:31:54 -0000 Mailing-List: contact cocoon-dev-help@xml.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: cocoon-dev@xml.apache.org Delivered-To: mailing list cocoon-dev@xml.apache.org Received: (qmail 55119 invoked from network); 9 Jan 2002 17:31:54 -0000 Message-ID: From: "Durrant, Peter" To: "'cocoon-dev@xml.apache.org'" Subject: RE: ESQL Extension Date: Wed, 9 Jan 2002 12:30:08 -0500 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Diff of esql.xsl to show changes: --- Original esql.xsl called oldesql.xsl Modified esql.xsl called esq.xsl + indicates addition ! indicates change --- *** oldesql.xsl Thu Nov 29 12:09:24 2001 --- esql.xsl Wed Jan 9 12:45:56 2002 *************** *** 207,212 **** --- 207,213 ---- java.sql.Connection java.sql.Statement java.sql.PreparedStatement + java.sql.CallableStatement java.sql.ResultSet java.sql.ResultSetMetaData java.sql.SQLException *************** *** 289,294 **** --- 290,296 ---- String query; Statement statement; PreparedStatement prepared_statement; + CallableStatement stored_procedure; ResultSet resultset; ResultSetMetaData resultset_metadata; /** the position of the current row in the resultset **/ *************** *** 296,301 **** --- 298,304 ---- int max_rows = -1; int skip_rows = 0; boolean results; + boolean stored_procedure_expect_bound_results = false; } private final String getAscii(ResultSet set, String column) { *************** *** 546,551 **** --- 549,597 ---- } try { + + + try { + _esql_query.stored_procedure = _esql_connection.connection.prepareCall(_esql_query.query); + } catch (SQLException _esql_exception_) { + throw new RuntimeException("Error preparing stored procedure: "+_esql_query.query+": "+_esql_exception_.getMessage()); + } + _esql_query.statement = _esql_query.stored_procedure; + + try { + _esql_query.stored_procedure. + + + + + + + + set(,); + + + + setString(,String.valueOf()); + + + + + + + registerOutParameter(,); + _esql_query.stored_procedure_expect_bound_results = true; + + + } catch (SQLException _esql_exception_) { + throw new RuntimeException("Error setting parameter on statement: "+_esql_query.query+": "+_esql_exception_); + } + + try { + _esql_query.results = _esql_query.stored_procedure.execute(); + } catch (SQLException _esql_exception_) { + throw new RuntimeException("Error executed stored procedure: "+_esql_query.query+": "+_esql_exception_); + } + try { *************** *** 592,600 **** getLogger().debug("esql query: "+_esql_query.query); ! if (_esql_query.results) { do { _esql_query.resultset = _esql_query.statement.getResultSet(); _esql_query.resultset_metadata = _esql_query.resultset.getMetaData(); _esql_query.position = 0; if (_esql_connection.use_limit_clause == 0 && _esql_query.skip_rows > 0) { --- 638,650 ---- getLogger().debug("esql query: "+_esql_query.query); ! if (_esql_query.results || _esql_query.stored_procedure_expect_bound_results) { do { + if (_esql_query.results) _esql_query.resultset = _esql_query.statement.getResultSet(); + else + _esql_query.resultset = (ResultSet)_esql_query.stored_procedure.getObject(1); + _esql_query.resultset_metadata = _esql_query.resultset.getMetaData(); _esql_query.position = 0; if (_esql_connection.use_limit_clause == 0 && _esql_query.skip_rows > 0) { This message may contain privileged and/or confidential information. If you have received this e-mail in error or are not the intended recipient, you may not use, copy, disseminate, or distribute it; do not open any attachments, delete it immediately from your system and notify the sender by e-mail promptly that you have done so. Thank You. --------------------------------------------------------------------- To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org For additional commands, email: cocoon-dev-help@xml.apache.org