ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Edwin S Lukaweski" <serj...@rogers.com>
Subject Re: DAO catch SQLexceptions
Date Mon, 05 Dec 2005 11:31:18 GMT
    Thank you for the prompt answer. You are right. The specific situation I 
described will return null.

    That still leaves the question, in my mind, about catching SQLExceptions 
in general. There may be other situations that cause an SQLException, such 
as an invalid SELECT statement. Is there a way of catching these?

thanks,
Edwin

----- Original Message ----- 
From: "Larry Meadors" <lmeadors@apache.org>
To: <user-java@ibatis.apache.org>
Sent: Sunday, December 04, 2005 6:19 PM
Subject: Re: DAO catch SQLexceptions


That would not throw an exception anyway - the returned object would
simply be null.

Larry


On 12/4/05, Edwin S Lukaweski <serjann@rogers.com> wrote:
>
>
> I am using Ibatis Data Access Objects. I cannot figure out how to catch
> SQLExceptions when using methods like "group =
> (Group)queryForObject("getGroup", oid);"
>
>     I wish to catch the fact that a row may not exist and report the error
> back to the user. The Data Mapper seems to provide SQLExceptions bu the 
> DAO
> methods do not.
>
>     Any help would be appreciated.
>
> Edwin



Mime
View raw message