Return-Path: Delivered-To: apmail-commons-issues-archive@locus.apache.org Received: (qmail 30778 invoked from network); 16 Mar 2008 22:51:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Mar 2008 22:51:11 -0000 Received: (qmail 40076 invoked by uid 500); 16 Mar 2008 22:51:07 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 39997 invoked by uid 500); 16 Mar 2008 22:51:07 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 39988 invoked by uid 99); 16 Mar 2008 22:51:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2008 15:51:07 -0700 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.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Mar 2008 22:50:38 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 5D621234C09D for ; Sun, 16 Mar 2008 15:49:27 -0700 (PDT) Message-ID: <1616709759.1205707767381.JavaMail.jira@brutus> Date: Sun, 16 Mar 2008 15:49:27 -0700 (PDT) From: "Dennis Lundberg (JIRA)" To: issues@commons.apache.org Subject: [jira] Closed: (DBUTILS-38) example documentation page, update query MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/DBUTILS-38?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Dennis Lundberg closed DBUTILS-38. ---------------------------------- Resolution: Fixed Fix Version/s: 1.2 Assignee: Dennis Lundberg Fixed in r637681. > example documentation page, update query > ---------------------------------------- > > Key: DBUTILS-38 > URL: https://issues.apache.org/jira/browse/DBUTILS-38 > Project: Commons DbUtils > Issue Type: Improvement > Reporter: David Portabella > Assignee: Dennis Lundberg > Priority: Minor > Fix For: 1.2 > > > Hello, > I came across DBUtils: > http://jakarta.apache.org/commons/dbutils/examples.html > and I found your contact email: > http://jakarta.apache.org/commons/dbutils/team-list.html > In this example page, you show how to query a db, and get a bean object: > {code} > QueryRunner run = new QueryRunner(dataSource); > ResultSetHandler h = new BeanHandler(Person.class); > Person p = (Person) run.query("SELECT * FROM Person WHERE name=?", "John Doe", h); > {code} > It would be great to show also that it can handle list of objects: > {code} > QueryRunner run = new QueryRunner(dataSource); > ResultSetHandler h = new BeanHandler(Person.class); > List list = (List) run.query("SELECT * FROM Person WHERE name=?", "John Doe", h); > while (Person p : list) > System.out.println(p); > {code} > or something like this. > More importantly, it is not obvious how to execute an update query, using a bean object. > I did not find it in the documentation. > Would it be something like this? > {code} > QueryRunner run = new QueryRunner(dataSource); > ResultSetHandler h = new BeanHandler(Person.class); > Person p = (Person) run.query("SELECT * FROM Person WHERE name=?", "John Doe", h); > p.setName("new name"); > run.update("UPDATE Person WHERE name = "John Doe", p); > {code} > Could you please add the correct example in your example documentation webpage? > Regards, > DAvid Portabella -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.