OK. I just browsed through the DB2400Dialect code and looked into MySQLDialect too. Then I checked out the DB2/400 documentation and came into this decision - it is a BUG.
Correct me if I am wrong.
Here is documentation about DB2/400 datatypes:
http://publib.boulder.ibm.com/infocente ... h2data.htm
In DB2Dialect it says:
registerColumnType( Types.VARBINARY, "varchar($l) for bit data" );
I am trying to create field with lenght of 4000000 and in documentation it says that VARCHAR must be between 1 and 32762 inclusive.
In MySQLDialect is say:
registerColumnType( Types.VARBINARY, "longblob" );
registerColumnType( Types.VARBINARY, 16777215, "mediumblob" );
registerColumnType( Types.VARBINARY, 65535, "blob" );
registerColumnType( Types.VARBINARY, 255, "tinyblob" );
I think that in DB2400Dialect is should be something like:
registerColumnType( Types.VARBINARY, "blob($l)" );
registerColumnType( Types.VARBINARY, 32762 "varchar($l) for bit data" );
Am I right ?
(BTW, IMHO that VARCHAR type shouldn't be used to store binary data anyway. In my experience it fails on some database versions and fixlevels, but that is entirely different matter. There is also VARBINARY datatype natively so there is no need to use VARCHAR for bitdata anyway)