ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Hixson <mhix...@activerain.com>
Subject Re: getting data and time into Oracle records
Date Fri, 01 Sep 2006 20:21:52 GMT
Hi Paul, have you tried setting your MYDATE column to a type of  
DATETIME?  This is how we're storing date+time information.
   -M@

On Sep 1, 2006, at 12:46 PM, 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