ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Butler <jeffgbut...@gmail.com>
Subject Re: Insert a date with time
Date Wed, 14 Dec 2005 20:29:11 GMT
What's the datatype of the datesubmitted field in the database?  Are you
sure it's TIMESTAMP or DATETIME, and not just DATE?

If the database is right, you could try this too:

<insert id="insertProjectStmt"
parameterClass="com.parsons.bmt.requirement.beans.ProjectBean">
    <selectKey resultClass="int" keyProperty="projectref">
      SELECT seq_project.nextval AS projectref FROM DUAL
    </selectKey>
    <![CDATA[
      INSERT INTO rm_project (projectref,   title,   datesubmitted,
pdcnumber)
                      VALUES (#projectref#, #title#, #datesubmitted*
:TIMESTAMP*#,
#pdcnumber#)
    ]]>
  </insert>

Jeff Butler

On 12/14/05, Vu, Thai <Thai.Vu@parsons.com> wrote:
> I used this thing to insert a new row
>
>  <insert id="insertProjectStmt"
> parameterClass="com.parsons.bmt.requirement.beans.ProjectBean">
>    <selectKey resultClass="int" keyProperty="projectref">
>      SELECT seq_project.nextval AS projectref FROM DUAL
>    </selectKey>
>    <![CDATA[
>      INSERT INTO rm_project (projectref,   title,   datesubmitted,
> pdcnumber)
>                      VALUES (#projectref#, #title#, #datesubmitted#,
> #pdcnumber#)
>    ]]>
>  </insert>
>
> Then I looked at the table and noticed that the datesubmitted field had
> the date only. How can I add time to that field? The problem isn't
> solved even when datesubmitted in the ProjectBean is of type
> java.sql.Timestamp.
>

Mime
View raw message