I found a problem with JDBC requests, and have submitted it to the
bug database.  The fix is just a few lines, and I attempted to attach
a patch file to the bug report, but can't tell if it took
(I'm a Bugzilla newbie ;-(),  so I'm posting the patch here as
well.
        Kate
Index: JDBCSampler.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-jmeter/src/org/apache/jmeter/protocol/jdbc/sampler/JDBCSampler.java,v
retrieving revision 1.12
diff -u -r1.12 JDBCSampler.java
--- JDBCSampler.java    16 Feb 2002 03:21:41 -0000      1.12
+++ JDBCSampler.java    8 Apr 2002 21:22:18 -0000
@@ -110,7 +110,11 @@
                Connection con = null;
                ResultSet rs = null;
                Statement stmt = null;
-               Data data = new Data();
+               String resultText = "";
+
+               // TODO: should be replaced with call to logging facility
+               System.out.println("SQL: " + sql.getQuery());
+
                res.putValue(SampleResult.SAMPLE_LABEL, sql.getQuery());
                start = System.currentTimeMillis();
                try
@@ -132,12 +136,13 @@
                        if (retVal)
                        {
                                rs = stmt.getResultSet();
-                               data = getDataFromResultSet(rs);
+                               resultText = getDataFromResultSet(rs).toString();
                                rs.close();
                        }
                        else
                        {
                                int updateCount = stmt.getUpdateCount();
+                               resultText += updateCount;
                        }
                        stmt.close();
                        manager.releaseConnection(con);
@@ -173,7 +178,7 @@
                end = System.currentTimeMillis();
                time += end - start;
                res.setTime(time);
-               res.putValue(SampleResult.TEXT_RESPONSE, data.toString().getBytes());
+               res.putValue(SampleResult.TEXT_RESPONSE, resultText.getBytes());
                return res;
        }
 

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to