M$ SQL-Server the Timestamp is not a Date but and number to indicate
the version of the record. Every update on this record will change the
Timestamp
to a new, unique number. Use the datetime data type of the attribute in your
table.
Have fun - Mad Andy / Better Pizza
Senior Java Developer
eBuilt Inc. (www.ebuilt.com)
while( true ) { think(); write(); publish(); }
----- Original Message -----
From: "Steven Haines" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, December 29, 2000 11:51 AM
Subject: [jBoss-User] TIMESTAMP and SQL Server
> Hi All,
>
> I am having a problem using CMP on a Timestamp field
> when talking to SQL Server. I am getting the following
> exception:
>
> [CPXManagerBean] javax.ejb.CreateException: Could not
> create entity:java.sql.SQLException:
> [SHAINES]Disallowed implicit conversion from data type
> varchar to data type timestamp, table
> 'ConfigServer.dbo.cpx', column 'effective_date'. Use
> the CONVERT function to run this query.
>
> I am passing a java.sql.Timestamp object to the create
> method, the field is a Timestamp, and my jaws.xml
> mapping looks like this:
>
> <type-mapping>MS SQLSERVER</type-mapping>
>
> <enterprise-beans>
> <entity>
> <ejb-name>CPXBean</ejb-name>
> <table-name>cpx</table-name>
> <create-table>false</create-table>
>
> ...
>
> <cmp-field>
> <field-name>effectiveDate</field-name>
> <column-name>effective_date</column-name>
> </cmp-field>
>
> ...
>
> <type-mapping>
> <name>MS SQLSERVER</name>
> ...
> <mapping>
>
> <java-type>java.sql.Timestamp</java-type>
> <jdbc-type>TIMESTAMP</jdbc-type>
> <sql-type>TIMESTAMP</sql-type>
> </mapping>
> ...
> </type-mapping>
>
> If I make the column null-able and add null to it, it
> adds just fine, but subsequent queries of that field
> yield the following exception:
>
> [CPXManagerBean] java.sql.SQLException:
> [SHAINES]Cannot update a timestamp column.
>
>
> Any help would be greatly appreciated!
> Steve
>
> =====
> Steven Haines
> Technical Lead
> IPNet Solutions
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> (949)476-4463 x388
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - Share your holiday photos online!
> http://photos.yahoo.com/
>
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> List Help?: [EMAIL PROTECTED]
>
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
List Help?: [EMAIL PROTECTED]