From torque-dev-return-6776-apmail-db-torque-dev-archive=db.apache.org@db.apache.org Mon May 29 08:24:57 2006 Return-Path: Delivered-To: apmail-db-torque-dev-archive@www.apache.org Received: (qmail 37751 invoked from network); 29 May 2006 08:24:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 May 2006 08:24:57 -0000 Received: (qmail 90100 invoked by uid 500); 29 May 2006 08:24:57 -0000 Delivered-To: apmail-db-torque-dev-archive@db.apache.org Received: (qmail 90084 invoked by uid 500); 29 May 2006 08:24:56 -0000 Mailing-List: contact torque-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Developers List" Reply-To: "Apache Torque Developers List" Delivered-To: mailing list torque-dev@db.apache.org Received: (qmail 90071 invoked by uid 99); 29 May 2006 08:24:56 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 01:24:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.24.207.26] (HELO mail.seitenbau.net) (217.24.207.26) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 01:24:55 -0700 Received: from [192.168.15.18] (helo=www.seitenbau.net) by router.seitenbau.net with esmtp (Exim 4.43) id 1Fkd3C-0006Z2-AE for torque-dev@db.apache.org; Mon, 29 May 2006 10:24:34 +0200 In-Reply-To: Subject: RE: Using native JDBC with Torque To: "Apache Torque Developers List" X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: Thomas Fischer Date: Mon, 29 May 2006 10:24:32 +0200 X-MIMETrack: Serialize by Router on www/seitenbau(Release 7.0.1|January 17, 2006) at 29.05.2006 10:24:33 AM MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Whenever you call getConnection() manually, you must close this connection. If you have any sugestions to improve the documentation, patches are welcome (preferably via jira). Thomas "Trevor Miller" schrieb am 29.05.2006 09:59:06: > Hi All, > > I'm using native JDBC to perform a slect count in conjunction with torque. > > Connection con = Torque.getConnection(); > String sql = "SELECT COUNT(menu_id) FROM menu WHERE parent_id=?"; > PreparedStatement pStmt = con.prepareStatement(sql); > pStmt.setInt(1,menuId); > ResultSet rs = pStmt.executeQuery(); > if (rs != null && rs.next()) > { > result = rs.getInt(1); > } > rs.close(); > pStmt.close(); > > Should I call close on the connection object or not. This feature is > not well documented. > > Trevor > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org > For additional commands, e-mail: torque-dev-help@db.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org For additional commands, e-mail: torque-dev-help@db.apache.org