[Opensource] Type Mapping SQL Server 2000.
Yonghua Zhai
yzhai at nbnet.nb.ca
Fri Jun 7 20:32:38 PDT 2002
Dave,
Tonight I got it working finally, see the db definition below:
<context name="default">
<description>SQLServer2K</description>
<jdbc
driver="com.microsoft.jdbc.sqlserver.SQLServerDriver"
url="jdbc:microsoft:sqlserver://yonghua:1433;databaseName=expresso"
connectFormat="1"
login="expresso"
password="expresso"
dateSelectFormat="dd-MM-yyyy"
dateUpdateFormat="dd-MM-yyyy"
dateTimeSelectFormat="yyyy-MM-dd"
dateTimeUpdateFormat="yyyy-MM-dd"
createTableIndicies="true"
cache="y">
<dbWildcard>%</dbWildcard>
<dbWildcard>*</dbWildcard>
</jdbc>
<type-mapping>
<java-type>LONGVARCHAR</java-type>
<expresso-type>text</expresso-type>
<db-type>text</db-type>
</type-mapping>
<type-mapping>
<java-type>DATE</java-type>
<db-type>datetime</db-type>
</type-mapping>
<type-mapping>
<java-type>DOUBLE</java-type>
<db-type>NUMERIC</db-type>
</type-mapping>
<type-mapping>
<java-type>LONGVARCHAR</java-type>
<db-type>VARCHAR(1024)</db-type>
</type-mapping>
<type-mapping>
<java-type>INTEGER</java-type>
<db-type>int</db-type>
</type-mapping>
<type-mapping>
<java-type>NUMERIC</java-type>
<db-type>NUMERIC</db-type>
</type-mapping>
<images>%context%/%expresso-dir%/images</images>
<startJobHandler>y</startJobHandler>
<showStackTrace>y</showStackTrace>
<mailDebug>n</mailDebug>
</context>
-----Original Message-----
From: opensource-admin at jcorporate.com
[mailto:opensource-admin at jcorporate.com] On Behalf Of Dave Smith
Sent: Thursday, June 06, 2002 10:08 PM
To: Opensource at javacorporate.com
Subject: [Opensource] Type Mapping SQL Server 2000.
Hi,
I'm trying to figure out the type mapping for SQL Server 2000.
I'm using the MS JDBC driver.
This mapping got me past the multiple identity field error, mentioned in
a previous post.
<type-mapping>
<java-type>INTEGER</java-type>
<db-type>int</db-type>
</type-mapping>
However now I'm having trouble finding a mapping for DATE.
According to the following documentation from MS on their JDBC
datatypes,
SQL server's datetime maps to the JDBC's timestamp.
Table 3-2. SQL Server 2000 Data Types
SQL Server Data | Type JDBC Data Type
bigint | BIGINT
bigint identity | BIGINT
binary | BINARY
bit | BIT
char | CHAR
datetime | TIMESTAMP
Based on this I used the following mapping in my expresso-config.xml but
its no worky worky.
<type-mapping>
<java-type>TIMESTAMP</java-type>
<expresso-type>DATE</expresso-type>
<db-type>datetime</db-type>
</type-mapping>
but it produces the following error.
"javax.servlet.ServletException: There was no mapping of the
java.sql.Type.DATE type to a specific database type. Either this type is
not supported by the specified JDBC driver, or there should be an type
mapping entry in expresso-config.xml"
Anyone have any suggestions???
Thanks,
Dave
_______________________________________________
Opensource mailing list
Opensource at jcorporate.com
http://mail.jcorporate.com/mailman/listinfo/opensource
Archives: http://mail.jcorporate.com/pipermail/opensource/
More information about the Opensource
mailing list