cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r413888 - in /cocoon/trunk/blocks/cocoon-databases: cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java status.xml
Date Tue, 13 Jun 2006 12:32:10 GMT
Author: vgritsenko
Date: Tue Jun 13 05:32:09 2006
New Revision: 413888

URL: http://svn.apache.org/viewvc?rev=413888&view=rev
Log:
   <action dev="VG" type="fix" fixes-bug="COCOON-1247">
     Support multiple results in SQLTransformer.
   </action>
   <action dev="VG" type="fix" fixes-bug="COCOON-1552">
     Fix NPE in SQLTransformer in error handling code.
   </action>

Modified:
    cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
    cocoon/trunk/blocks/cocoon-databases/status.xml

Modified: cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java?rev=413888&r1=413887&r2=413888&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
(original)
+++ cocoon/trunk/blocks/cocoon-databases/cocoon-databases-impl/src/main/java/org/apache/cocoon/transformation/SQLTransformer.java
Tue Jun 13 05:32:09 2006
@@ -1118,6 +1118,8 @@
 
             this.outUri = this.params.getParameter(SQLTransformer.MAGIC_NS_URI_ELEMENT, SQLTransformer.this.namespaceURI);
             this.outPrefix = this.params.getParameter(SQLTransformer.MAGIC_NS_PREFIX_ELEMENT,
"sql");
+            this.rowsetElement = this.params.getParameter(SQLTransformer.MAGIC_DOC_ELEMENT,
"rowset");
+            this.rowElement = this.params.getParameter(SQLTransformer.MAGIC_ROW_ELEMENT,
"row");
 
             this.showNrOfRows = parameters.getParameterAsBoolean(SQLTransformer.MAGIC_NR_OF_ROWS,
false);
             this.clobEncoding = parameters.getParameter(SQLTransformer.CLOB_ENCODING, "");
@@ -1189,8 +1191,6 @@
          * Execute the query. Connection must be set already.
          */
         private void execute() throws SQLException {
-            this.rowsetElement = params.getParameter(SQLTransformer.MAGIC_DOC_ELEMENT, "rowset");
-            this.rowElement = params.getParameter(SQLTransformer.MAGIC_ROW_ELEMENT, "row");
             setColumnCase(params.getParameter(SQLTransformer.MAGIC_COLUMN_CASE, "lowercase"));
 
             // Construct query string
@@ -1305,12 +1305,22 @@
                 return true;
             }
 
-            if (rs == null || !rs.next()) {
-                // No more rows.
-                return false;
+            if (rs != null && rs.next()) {
+                // Have next row
+                return true;
+            }
+
+            while (pst.getMoreResults()) {
+                rs = pst.getResultSet();
+                md = rs.getMetaData();
+                if (rs.next()) {
+                    // Have next row in next result set
+                    return true;
+                }
             }
 
-            return true;
+            // Nothing left
+            return false;
         }
 
         /**

Modified: cocoon/trunk/blocks/cocoon-databases/status.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-databases/status.xml?rev=413888&r1=413887&r2=413888&view=diff
==============================================================================
--- cocoon/trunk/blocks/cocoon-databases/status.xml (original)
+++ cocoon/trunk/blocks/cocoon-databases/status.xml Tue Jun 13 05:32:09 2006
@@ -65,6 +65,12 @@
  <!-- The following list contains the changes since the latest 2.1.x version. -->
  <changes>
   <release version="@version@" date="@date@">
+   <action dev="VG" type="fix" fixes-bug="COCOON-1247">
+     Support multiple results in SQLTransformer.
+   </action>
+   <action dev="VG" type="fix" fixes-bug="COCOON-1552">
+     Fix NPE in SQLTransformer in error handling code.
+   </action>
    <action dev="VG" type="update">
     Support CLOBs in SQLTransformer when returned as stored procedure
     parameters, or as columns in a cursor returned by stored procedure.



Mime
View raw message