DB2400Dialect.getIdentitySelectString() fails when naming=system since it returns:
"select identity_val_local() from sysibm.sysdummy1"
it should return:
"select identity_val_local() from sysdummy1"
Error:
When using DB2400Dialect with naming=system, the following error
something like this will be generated in log:
SQL5016] Qualified object name SYSDUMMY1 not valid
Explanation:
On db2 on as/400, table names in sql can be fully qualified with schema name or unqaulified but they can't be mixed.
Qualified naming example:
When "naming" jdbc property is configured as:
jdbc:db2://someserver;naming=sql
then tables must be qualified with schema name:
select * from schema1.mytable
Unqualified naming example:
When "naming" and "library" jdbc properties are configured as:
jdbc:db2://someserver;naming=system;libraries=schema1,schema2,sysibm
then tables must NOT be qualified with schema name:
select * from mytable
mytable will be searched for in schema1 then schema2 then sysibm.
Solution:
The solution would be to allow DB2400Dialect to know when naming=system, then to omit "sysibm." qualification in sql.
See:
http://publib.boulder.ibm.com/infocente ... operty.htm
http://publib.boulder.ibm.com/infocente ... /rzahh.pdf (page 313)