Return-Path: Delivered-To: apmail-incubator-ibatis-user-java-archive@www.apache.org Received: (qmail 90701 invoked from network); 9 May 2005 15:10:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 May 2005 15:10:42 -0000 Received: (qmail 42905 invoked by uid 500); 9 May 2005 15:07:29 -0000 Delivered-To: apmail-incubator-ibatis-user-java-archive@incubator.apache.org Received: (qmail 42886 invoked by uid 500); 9 May 2005 15:07:29 -0000 Mailing-List: contact ibatis-user-java-help@incubator.apache.org; run by ezmlm Precedence: bulk Reply-To: ibatis-user-java@incubator.apache.org List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list ibatis-user-java@incubator.apache.org Received: (qmail 42871 invoked by uid 99); 9 May 2005 15:07:28 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=MSGID_FROM_MTA_HEADER X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of lieven_dekeyzer@hotmail.com designates 64.4.49.29 as permitted sender) Received: from bay14-f29.bay14.hotmail.com (HELO hotmail.com) (64.4.49.29) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 09 May 2005 08:07:27 -0700 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Mon, 9 May 2005 08:04:04 -0700 Message-ID: Received: from 81.240.24.240 by by14fd.bay14.hotmail.msn.com with HTTP; Mon, 09 May 2005 15:04:04 GMT X-Originating-IP: [81.240.24.240] X-Originating-Email: [lieven_dekeyzer@hotmail.com] X-Sender: lieven_dekeyzer@hotmail.com In-Reply-To: <16178eb1050509073557137101@mail.gmail.com> From: "Lieven De Keyzer" To: ibatis-user-java@incubator.apache.org Bcc: Subject: Re: SQLException when deleting Date: Mon, 09 May 2005 15:04:04 +0000 Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-OriginalArrivalTime: 09 May 2005 15:04:04.0849 (UTC) FILETIME=[57759610:01C554A8] X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This indeed solved my problem. Thanks a lot! >From: Clinton Begin >Reply-To: cbegin@ibatis.com >To: Lieven De Keyzer >Subject: Re: SQLException when deleting >Date: Mon, 9 May 2005 08:35:28 -0600 > >Try getting v2.0.9b. JPetStore doesn't necessarily come with the latest >iBATIS JAR. They are separate development paths. > >Cheers, >Clinto > >On 5/9/05, Lieven De Keyzer wrote: > > > > > > > > >From: Clinton Begin > > >Reply-To: cbegin@ibatis.com > > >To: ibatis-user-java@incubator.apache.org > > >Subject: Re: SQLException when deleting > > >Date: Sun, 8 May 2005 21:45:01 -0600 > > > > > >Odd....the DAO template doesn't throw an exception... > > > > > > public int delete(String id, Object parameterObject) { > > > > > > > > >Maybe you're using an old version of the framework? > > > > I'm using the same jar files for the DAO and SqlMaps frameworks as used >in > > the latest version of the JPetStore example. > > > > Anyway, here is the complete file: > > > > package com.vub.bookmarked.persistence.sqlmapdao; > > > > import com.ibatis.dao.client.DaoManager; > > import com.vub.bookmarked.domain.Account; > > import com.vub.bookmarked.persistence.iface.AccountDao; > > > > public class AccountSqlMapDao extends BaseSqlMapDao implements >AccountDao > > { > > > > public AccountSqlMapDao(DaoManager daoManager) { > > super(daoManager); > > } > > > > public Account getAccount(String username) { > > return (Account) queryForObject("getAccountByUsername", username); > > } > > > > public Account getAccount(String username, String password) { > > Account account = new Account(); > > account.setUsername(username); > > account.setPassword(password); > > return (Account) queryForObject("getAccountByUsernameAndPassword", > > account); > > } > > > > public void insertAccount(Account account) { > > insert("insertAccount", account); > > } > > > > public void updateAccount(Account account) { > > update("updateAccount", account); > > } > > > > public void deleteAccount(Account account) { > > delete("deleteAccount", account); > > } > > > > } > > > > > > > > > > >Cheers, > > >Clinton > > > > > > > > > > > > > > >On 5/8/05, Lieven De Keyzer wrote: > > > > > > > > This is a snapshot of my AccountSqlMapDao, following the concepts of > > the > > > > latest JPetStore. > > > > > > > > public void insertAccount(Account account) { > > > > insert("insertAccount", account); > > > > } > > > > > > > > public void updateAccount(Account account) { > > > > update("updateAccount", account); > > > > } > > > > > > > > public void deleteAccount(Account account) { > > > > delete("deleteAccount", account); > > > > } > > > > > > > > I get an error however in deleteAccount: > > > > > > > > unreported exception java.sql.SQLException; must be caught or >declared > > >to > > > > be > > > > thrown > > > > > > > > [javac] delete("deleteAccount", account); > > > > > > > > Why do I need to catch the exception for the delete statement, but >not > > >for > > > > the insert or update method? > > > > > > > > > > > >