Return-Path: Delivered-To: apmail-commons-commits-archive@minotaur.apache.org Received: (qmail 81151 invoked from network); 18 Sep 2010 19:18:26 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 18 Sep 2010 19:18:26 -0000 Received: (qmail 58947 invoked by uid 500); 18 Sep 2010 19:18:26 -0000 Delivered-To: apmail-commons-commits-archive@commons.apache.org Received: (qmail 58894 invoked by uid 500); 18 Sep 2010 19:18:25 -0000 Mailing-List: contact commits-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@commons.apache.org Delivered-To: mailing list commits@commons.apache.org Received: (qmail 58887 invoked by uid 99); 18 Sep 2010 19:18:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Sep 2010 19:18:25 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Sep 2010 19:18:24 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8E61C2388A38; Sat, 18 Sep 2010 19:18:04 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r998525 - /commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java Date: Sat, 18 Sep 2010 19:18:04 -0000 To: commits@commons.apache.org From: psteitz@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20100918191804.8E61C2388A38@eris.apache.org> Author: psteitz Date: Sat Sep 18 19:18:04 2010 New Revision: 998525 URL: http://svn.apache.org/viewvc?rev=998525&view=rev Log: Support no-op as query option. Modified: commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java Modified: commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java URL: http://svn.apache.org/viewvc/commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java?rev=998525&r1=998524&r2=998525&view=diff ============================================================================== --- commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java (original) +++ commons/sandbox/performance/trunk/src/java/org/apache/commons/performance/dbcp/DBCPClientThread.java Sat Sep 18 19:18:04 2010 @@ -36,7 +36,7 @@ import org.apache.commons.performance.St */ public class DBCPClientThread extends ClientThread { /** Initial segment of query string */ - private String queryString; + private String queryString = null; /** Whether or not the query is on the text column */ private boolean textQuery = false; /** DataSource used to connect */ @@ -76,6 +76,10 @@ public class DBCPClientThread extends Cl this.dataSource = dataSource; + if (queryType.equals("no-op")) { + return; + } + if (queryType.equals("integerIndexed")) { queryString = "select * from test_table WHERE indexed="; } else if (queryType.equals("integerScan")) { @@ -88,6 +92,9 @@ public class DBCPClientThread extends Cl /** Generate a random query */ public void setUp() throws Exception { + if (queryString == null) { + return; + } if (textQuery) { currentQuery = queryString + randomData.nextHexString(20) + "';"; @@ -100,6 +107,9 @@ public class DBCPClientThread extends Cl /** Execute query */ public void execute() throws Exception { conn = dataSource.getConnection(); + if (queryString == null) { + return; + } Statement stmt = conn.createStatement(); stmt.execute(currentQuery); ResultSet rs = stmt.getResultSet();