[daisy] Porting to DB2

Aaron.Digulla at Globus.ch Aaron.Digulla at Globus.ch
Wed Sep 13 09:45:12 CDT 2006


Hello,

> The constraint names are automatically assigned by torque/velocity, and
> Daisy doesn't use these names, thus they can be anything. So if possible
> I suggest you modify the velocity templates to generate short names
> (e.g. simply a prefix + counter).

I've added an ant task to do a search&replace on the long constraints. 
This is better than generating arbitrary names in case DB2 users have to 
upgrade the db.

The next thing I had to change is the mapping of BOOLEANCHAR fields in 
INSERT-statements because DB2 doesn't automatically map from 1 to '1':

diff val.vm:
- 
#if($column.Column.needEscapedValue())$column.EscapedValue#else$column.Value#end
+ #if($column.Column.needEscapedValue() || 
$column.Column.isBooleanChar())$column.EscapedValue#else$column.Value#end

Now, I can setup the DB. But after starting the server, I get:

com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE: -206, SQLSTATE: 
42703, SQLERRMC: name
com.ibm.db2.jcc.b.jd.executeQuery(jd.java:488)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:91)
org.outerj.daisy.repository.serverimpl.user.LocalUserManagementStrategy.getRoleWhereId(LocalUserManagementStrategy.java:503)
...

The offending query is:

    private static final String SELECT_ALL_FROM_ROLES = "select id, 
\"name\", description, last_modified, last_modifier, updatecount from 
roles";

Why is name quoted in this query?

Regards,

-- 
Aaron Digulla



More information about the daisy mailing list