Bruce,

I used to have that problem.  Here is the default setting I have in my 
JBoss3.0.0's standardjbosscmp-jdbc.xml:

        <mapping>
            <java-type>java.util.Date</java-type>
            <jdbc-type>DATE</jdbc-type>
            <sql-type>DATETIME</sql-type>
         </mapping>

Also, in my jbosscmp-jdbc.xml I have:

     <entity>
        ............
        ............

        <cmp-field>
             <field-name>endDate</field-name>
             <column-name>END_DATE</column-name>
             <jdbc-type>DATE</jdbc-type>
             <sql-type>DATETIME</sql-type>
        </cmp-field>
     </entity>

Regards,
Douglas

>From: Bruce Roberts <[EMAIL PROTECTED]>
>Reply-To: [EMAIL PROTECTED]
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: [JBoss-user] MS SQLServer Date type mapping in 
>standardjbosscmp-jdbc.xml
>Date: Thu, 20 Jun 2002 09:54:54 -0700
>
>In JBoss3.0 final, the type mapping in standardjbosscmp-jdbc.xml
>for java.util.Date for MS SQLServer2000 and 7.0 is given as:
>
><mapping>
>     <java-type>java.util.Date</java-type>
>     <jdbc-type>DATE</jdbc-type>
>     <sql-type>DATETIME</sql-type>
></mapping>
>
>while for other databases such as Oracle and MySQL the <jdbc-type> is
>TIMESTAMP.  I'm using the JDBC driver that MS provides, and with that
>driver and the default SQLServer mapping, dates get put into the
>database (a DATETIME field) with no time information, only the date
>part.  I expect that because that's what a <jdbc-type> of DATE should
>do.  When I change the <jdbc-type> to TIMESTAMP, I get, again as
>expected, the full date and time information in the database.  I was
>wondering if the default setting for SQLServer for java.util.Date
>should be TIMESTAMP instead of DATE?
>
>Thanks,
>
>Bruce Roberts
>[EMAIL PROTECTED]
>
>
>




_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com



-------------------------------------------------------
Sponsored by:
ThinkGeek at http://www.ThinkGeek.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to