Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 47001 invoked from network); 2 Nov 2006 07:18:41 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Nov 2006 07:18:40 -0000 Received: (qmail 24267 invoked by uid 500); 2 Nov 2006 07:18:50 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 24185 invoked by uid 500); 2 Nov 2006 07:18:49 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 24174 invoked by uid 99); 2 Nov 2006 07:18:49 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2006 23:18:49 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Nov 2006 23:18:38 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id B7D707142C1 for ; Wed, 1 Nov 2006 23:18:17 -0800 (PST) Message-ID: <17239477.1162451897744.JavaMail.root@brutus> Date: Wed, 1 Nov 2006 23:18:17 -0800 (PST) From: "Henri Yandell (JIRA)" To: commons-dev@jakarta.apache.org Subject: [jira] Updated: (DBUTILS-17) [dbutils] ScalarHandler subclasses that return Integers and Longs MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ http://issues.apache.org/jira/browse/DBUTILS-17?page=all ] Henri Yandell updated DBUTILS-17: --------------------------------- Attachment: DBUTILS-17.patch Unit tests and modified class files to resolve this patch. I'm unsure yet if they should be added. The use-case is to make it easier to work out a count(*), but I'd expect it to only be saving the user a cast in the end (unless there are databases that like to return the result of select count(*) with a non Number type (we convert primitive ints etc up to Numbers). > [dbutils] ScalarHandler subclasses that return Integers and Longs > ----------------------------------------------------------------- > > Key: DBUTILS-17 > URL: http://issues.apache.org/jira/browse/DBUTILS-17 > Project: Commons DbUtils > Issue Type: Improvement > Environment: Operating System: All > Platform: All > Reporter: greg hawkes > Priority: Minor > Fix For: 1.1 > > Attachments: DBUTILS-17.patch, IntScalarHandler.java, LongScalarHandler.java > > > I (and, looking around, many other people) most often use ScalarHandler to fetch > the result of an SQL count(*) column. ScalarHandler works, but I was forever > needing to parse the result to create an Integer (and occasionally, a Long) > value. Several possible solutions have been proposed to make this task easier. > This is mine. > I have extended ScalarHandler to create IntScalarHandler and LongScalarHandler, > which return Integers and Longs, respectively. Their usage is exactly the same > as ScalarHandler. They have been tested on Oracle, MS-SQL Server, and PostgreSQL > databases, and have proven to be very effective. I hope that they can be > included in the DbUtils distribution, where they fit right alongside the > existing ScalarHandler. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-dev-help@jakarta.apache.org