[daisy] Porting to DB2
Bruno Dumon
bruno at outerthought.org
Thu Sep 14 03:16:06 CDT 2006
On Wed, 2006-09-13 at 16:45 +0200, Aaron.Digulla at Globus.ch wrote:
> 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?
This was contributed as part of a patch to support Oracle, however other
users have meanwhile reported that this doesn't work for Oracle either,
so in the trunk sources this is already removed again.
--
Bruno Dumon http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno at outerthought.org bruno at apache.org
More information about the daisy
mailing list