I am using Jboss 3.0.0beta2(200204121002) built with jdk 1.4 on Win2k SP2, with a DB2 7.2 database.
In my jbosscmp-jdbc.xml, I override the defaults in order to use my own datasource and I define <type-mapping>DB2</type-mapping>.
I have a few problems:
1) As my database tables are located in a tablespace, I have to prefix all <table-name> definitions with the name of my tablespace. That's ok (but could not there be a config. parameter to specify a prefix for tables names, when using tablespaces or tables owners ?). The problem is that the create table does not work when <pk-constraint> is true, because the name generated from template in standardjbosscmp-jdbc.xml looks like pk_TableSpace.TableName, and that is either too long or it is not recognized by DB2 because it contains too many qualifiers.
2) In standardjbosscmp-jdbc.xml, the DB2 default mapping for java.lang.String is
but the SQL statement generated looks like:
CREATE TABLE TableSpace.TableName (NAME VARCHAR(256) NOT NULL, VALEUR INTEGER)
when NAME is just a java.lang.String and that I do not override the default in my jbosscmp-jdbc.xml. It is the same problem for java.sql.Date mapping.
3) There is also a problem when <create-table> is true and that the table already exists, it will always try to recreate the table with a CREATE (...). I have checked the case of my table names, they are all uppercase.
If these are known bugs, or if you have any idea on how to solve them, please let me know.
I just added a <!DOCTYPE jbosscmp-jdbc> in my jbosscmp-jdbc.xml and replaced <type-mapping>DB2</type-mapping> by
<datasource-mapping>DB2</datasource-mapping> and it seems to work.
Is there any DTD available for this xml file (the one in jboss.org/j2ee/dtd is deprecated) ?