cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sonney <ke...@webslingerz.com>
Subject Re: esql with Vars, or esql diff of the moment...
Date Mon, 25 Sep 2000 14:36:42 GMT
On Mon, 25 Sep 2000, Kevin Sonney wrote:
> Anyone have any feedback on this one? Donald?

Of course, I forgot to attache the Diff, didn't I? Here it is :

Index: src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl
===================================================================
RCS file: /home/cvspublic/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl,v
retrieving revision 1.15
diff -u -r1.15 esql.xsl
--- src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl	2000/09/15 05:07:35	1.15
+++ src/org/apache/cocoon/processor/xsp/library/sql/esql.xsl	2000/09/25 14:40:53
@@ -110,7 +110,7 @@
                   DBConnection db_connection=null;
                   Connection connection=null;
                   boolean close_connection = true;
-		  String query;
+                  String query;
                   Statement statement;
                   ResultSet resultset;
                   ResultSetMetaData resultset_metadata;
@@ -143,7 +143,13 @@
 
  <xspdoc:desc>indicates that a sql connection is going to be defined and one or more
queries may be executed</xspdoc:desc>
 <xsl:template match="esql:execute-query">
- <xsp:logic>_esql_execute_query_<xsl:value-of select="generate-id(.)"/>(request,response,document,xspParentNode,xspCurrentNode,xspNodeStack,session,_esql_sessions,_esql_session);</xsp:logic>
+ <xsl:variable name="query">
+     <xsl:call-template name="get-nested-string">
+       <xsl:with-param name="content" select="esql:query"/>
+     </xsl:call-template>
+ </xsl:variable>
+ <xsp:logic>_esql_execute_query_<xsl:value-of select="generate-id(.)"/>(request,response,document,xspParentNode,xspCurrentNode,xspNodeStack,session,_esql_sessions,_esql_session,<xsl:copy-of
select="$query" />);
+</xsp:logic>
 </xsl:template>
 
 <xsl:template match="esql:execute-query" mode="generate-method">
@@ -182,11 +188,6 @@
 			<xsl:with-param name="content" select="esql:skip-rows"/>
 		</xsl:call-template>
 	</xsl:variable>
-	<xsl:variable name="query">
-		<xsl:call-template name="get-nested-string">
-			<xsl:with-param name="content" select="esql:query"/>
-		</xsl:call-template>
-	</xsl:variable>
 	<xsp:logic>
 	 void _esql_execute_query_<xsl:value-of select="generate-id(.)"/>(
 	 HttpServletRequest request,
@@ -197,7 +198,8 @@
 	 Stack xspNodeStack,
 	 HttpSession session,
 	 Stack _esql_sessions,
-	 EsqlSession _esql_session) throws Exception {
+	 EsqlSession _esql_session,
+	 String queryString) throws Exception {
 		if (_esql_session != null) {
 		 _esql_sessions.push(_esql_session);
 		}
@@ -241,7 +243,8 @@
 		 </xsl:otherwise>
 	        </xsl:choose>
 	       _esql_session.statement = _esql_session.connection.createStatement();
-	       _esql_session.query = String.valueOf(<xsl:copy-of select="$query"/>);
+<!--	       _esql_session.query = String.valueOf(<xsl:copy-of select="$query"/>);
-->
+	       _esql_session.query = queryString;
 	       _esql_session.resultset = _esql_session.statement.executeQuery(_esql_session.query);
 	       _esql_session.resultset_metadata = _esql_session.resultset.getMetaData();
 	       _esql_session.count = 0;

-- 
+-------------------------------------------+
| Kevin Sonney        kevin@webslingerZ.com |
| Systems Programmer    www.webslingerZ.com |
+-------------------------------------------+


Mime
View raw message