Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 30793 invoked from network); 14 Dec 2005 20:29:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Dec 2005 20:29:39 -0000 Received: (qmail 61992 invoked by uid 500); 14 Dec 2005 20:29:36 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 61971 invoked by uid 500); 14 Dec 2005 20:29:36 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 61960 invoked by uid 99); 14 Dec 2005 20:29:35 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2005 12:29:35 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of jeffgbutler@gmail.com designates 66.249.82.196 as permitted sender) Received: from [66.249.82.196] (HELO xproxy.gmail.com) (66.249.82.196) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Dec 2005 12:29:33 -0800 Received: by xproxy.gmail.com with SMTP id s19so149030wxc for ; Wed, 14 Dec 2005 12:29:12 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=fqR4KlnpHNuifHku7VQPdSUP0X5eJgViFijeFpgD68sONmhKZu4CljZpjSOHBOHmv4mU8xWy5ABgn3q2O+x3nFXrGWsPn5D9DHbgxwtHSwTZSGALSKkMjIo8iT+lVmBsZnNuZGqfkAYWFB4mvMwRA2ZPnVdvlboPVRBFPUFpOY4= Received: by 10.70.125.20 with SMTP id x20mr1101036wxc; Wed, 14 Dec 2005 12:29:11 -0800 (PST) Received: by 10.70.72.3 with HTTP; Wed, 14 Dec 2005 12:29:11 -0800 (PST) Message-ID: Date: Wed, 14 Dec 2005 14:29:11 -0600 From: Jeff Butler To: user-java@ibatis.apache.org Subject: Re: Insert a date with time In-Reply-To: <2F038EED15EF804A84175613FD39FA420241EE@exchdal04.Parsons.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_18602_11510676.1134592151870" References: <2F038EED15EF804A84175613FD39FA420241EE@exchdal04.Parsons.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_18602_11510676.1134592151870 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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: SELECT seq_project.nextval AS projectref FROM DUAL Jeff Butler On 12/14/05, Vu, Thai wrote: > I used this thing to insert a new row > > parameterClass=3D"com.parsons.bmt.requirement.beans.ProjectBean"> > > SELECT seq_project.nextval AS projectref FROM DUAL > > INSERT INTO rm_project (projectref, title, datesubmitted, > pdcnumber) > VALUES (#projectref#, #title#, #datesubmitted#, > #pdcnumber#) > ]]> > > > 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. > ------=_Part_18602_11510676.1134592151870 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
What's the datatype of the datesubmitted field in the database? &= nbsp;Are you sure it's TIMESTAMP or DATETIME, and not just DATE?

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

<insert id=3D"= ;insertProjectStmt"
parameterClass=3D"com.parsons.bmt.requirement.beans.ProjectBean&qu= ot;>
    <selectKey resultClass=3D"int&qu= ot; keyProperty=3D"projectref">
    &nb= sp; SELECT seq_project.nextval AS projectref FROM DUAL
    </selectKey>
    &= lt;![CDATA[
      INSERT INTO rm_project (= projectref,   title,   datesubmitted,
pdcnumber)
=             &nb= sp;         VALUES (#projectre= f#, #title#, #datesubmitted:TIMESTAMP #,
#pdcnumber#)
    ]]>
  </in= sert>
 
Jeff Butler

On 12/14/05, Vu, Thai <Thai.Vu@parsons.com> wrote:
> I used this thing = to insert a new row
>
>  <insert id=3D"inser= tProjectStmt"
> parameterClass=3D"com.parsons.bmt.requirement.beans.ProjectBe= an">
>    <selectKey resultClass=3D&qu= ot;int" keyProperty=3D"projectref">
>  &n= bsp;   SELECT seq_project.nextval AS projectref FROM DUAL
>    </selectKey>
>   = ; <![CDATA[
>      INSERT INTO = rm_project (projectref,   title,   datesubmitted,
&g= t; pdcnumber)
>         =             &nb= sp;VALUES (#projectref#, #title#, #datesubmitted#,
> #pdcnumber#)
>    ]]>
> &n= bsp;</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
&g= t; java.sql.Timestamp.
>
 
------=_Part_18602_11510676.1134592151870--