ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Albert L. Sapp" <as...@uiuc.edu>
Subject Re: getting data and time into Oracle records
Date Fri, 01 Sep 2006 20:17:59 GMT
Paul,

Here is what we do.  In the DAO we specify, #dateItemChanged:TIMESTAMP#.

Al

Paul Allen wrote:
> Could somebody share with me the secret to getting dates AND times 
> into Oracle DATE fields from java.util.Date properties?
>
> Even when I set the time portion of the java.util.Date I end up only 
> with the year+month+day in the DB.
>
> In a related question, where is the definative documentation for the 
> allowed format of inline parameters (i.e., the stuff between "#" and 
> "#")?
>
> Thanks for any help you can offer.
>
> Here's what I'm doing now:
>
> --- Java Class ---
>
> public class MyBean {
>         private java.util.Date myDate;
>         ...
>         public java.util.Date getMyDate() {...}
>         public void setMyDate(java.util.Date _myDate) { ... }
> }
>
>
> --- Ibatis Map ---
>
> <insert id="insertMyBean" parameterClass="MyBean">
>         INSERT INTO MYTABLE (MYDATE) VALUES (#myDate:DATE#)
> </insert>
>
> --- Oracle Table ---
>
> CREATE TABLE MYTABLE
> (
>   MYDATE DATE
> )


Mime
View raw message