#6 Jaws DB Mapping for MSSQL2000

v2.3 (unstable)
closed-accepted
Juha Lindfors
JBossCMP (86)
5
2001-04-14
2001-04-12
Anonymous
No

We had problems with the default jaws mapping for MS
SQLServer 7.0 and 2000.
Some of the default types were not supported by the DB
(for example the DOUBLE and BIGINT type).
Each time JBoss tries to load DB values into Beans
a "load failed exception" is thrown.
The mapping below solved this problem for us (we use
MS SQLServer2000) and could be included into the JBoss
distribution.
As mentioned before SQL Server 7.0 didn't work neither
maybe the standard jaws mapping should be updated as
well.
We would have preferred SQL Server 7.0 for our project
but we were not able to create a working mapping for
it.

This is our solution for SQLServer 2000:
---- snip ------ standardjaws.xml -------- snip -----
..
<type-mapping>
<name>MS SQLSERVER2000</name>
<mapping>
<java-type>java.lang.Integer</java-type>
<jdbc-type>INTEGER</jdbc-type>
<sql-type>INTEGER</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Character</java-
type>
<jdbc-type>CHAR</jdbc-type>
<sql-type>CHAR</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Short</java-type>
<jdbc-type>SMALLINT</jdbc-type>
<sql-type>SMALLINT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Long</java-type>
<jdbc-type>BIGINT</jdbc-type>
<sql-type>BIGINT</sql-type>
</mapping>
<mapping>
<java-type>java.math.BigDecimal</java-
type>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(256)</sql-type>
</mapping>
<mapping>
<java-type>java.lang.String</java-type>
<jdbc-type>VARCHAR</jdbc-type>
<sql-type>VARCHAR(256)</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Object</java-type>
<jdbc-type>JAVA_OBJECT</jdbc-type>
<sql-type>IMAGE</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Byte</java-type>
<jdbc-type>TINYINT</jdbc-type>
<sql-type>TINYINT</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Timestamp</java-type>
<jdbc-type>TIMESTAMP</jdbc-type>
<sql-type>TIMESTAMP</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Date</java-type>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATETIME</sql-type>
</mapping>
<mapping>
<java-type>java.sql.Time</java-type>
<jdbc-type>TIME</jdbc-type>
<sql-type>DATETIME</sql-type>
</mapping>
<mapping>
<java-type>java.util.Date</java-type>
<jdbc-type>DATE</jdbc-type>
<sql-type>DATETIME</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Boolean</java-type>
<jdbc-type>BIT</jdbc-type>
<sql-type>BIT</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Float</java-type>
<jdbc-type>REAL</jdbc-type>
<sql-type>REAL</sql-type>
</mapping>
<mapping>
<java-type>java.lang.Double</java-type>
<jdbc-type>DOUBLE</jdbc-type>
<sql-type>FLOAT</sql-type>
</mapping>
</type-mapping>
....

Discussion

  • Juha Lindfors
    Juha Lindfors
    2001-04-14

    • labels: --> JBossCMP
    • milestone: --> v2.3 (unstable)
    • assigned_to: nobody --> juhalindfors
    • status: open --> open-accepted
     
  • Juha Lindfors
    Juha Lindfors
    2001-04-14

    • status: open-accepted --> closed-accepted
     
  • Juha Lindfors
    Juha Lindfors
    2001-04-14

    Logged In: YES
    user_id=175239

    Committed to the MAIN branch (v2.3)