Agreed. You should transform the string representation into a java.util.Date object before passing it off to the database. (Regardless of the vendor) That way the JDBC driver will handle the work for you.
(Separation of concerns)




"Larry Meadors" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]

11/30/2007 03:34 AM

Please respond to
[email protected]

To
[email protected]
cc
Subject
Re: Problem with date format.





Why use a string for a date? Let the driver do it for you.

Date date = new Date();

queryForObject("some.query", date);

<select id="query" resultClass="blah">
 Select *
 from cust
 where cust_date = #value#
</select>

Larry


On Nov 30, 2007 12:33 AM, Yuvraj Shinde <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi all,
>
>
>
>    I am using dd/MM/yy date format in search querry for searching a data.
>
>
>
> For Eg
>
>
>
> Select * from cust where cust_date = 30/11/07
>
> it is giving me following exception
>
>
>
> [Oracle JDBC Driver][Oracle]ORA-01843: not a valid month.
>
>
>
>  How to set or change the date format in Ibatis. can anyone help me.
>
>
>  Regards
>
>  Yuvraj
>
>
>
>


Reply via email to