RE: SQL generation bug
Hi, [...] > (did anyone uses OJB for DB2 before?). Yep - we're using OJB on DB2/400, with no major problems. Cheers, Charles. This email and any attachments are strictly confidential and are intended solely for the addressee. If you are not the intended recipient you must not disclose, forward, copy or take any action in reliance on this message or its attachments. If you have received this email in error please notify the sender as soon as possible and delete it from your computer systems. Any views or opinions presented are solely those of the author and do not necessarily reflect those of HPD Software Limited or its affiliates. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a re- sult of the use of this medium to transmit information by or to HPD Software Limited or its affiliates. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
SQL generation bug
Hello, RC4 and DB2 The parameters in prepared statements are replaced incorrectly. Integers, long etc. are all surrounded by quotes! I modified PlatformDb2Impl.setObjectForStatement(...) to send the correct set-method to the prepared statement for these types. Now that works fine (did anyone uses OJB for DB2 before?). The weird thing: in the where condition of update statements, the values still were not correctly set (quotes for integers). I had a look into StatementManager.bindUpdate and replaced there the line stmt.setObject(index, values[i], SqlHelper.getSqlTypePk(cld, i)); with m_platform.setObjectForStatement(stmt, index, values[i], SqlHelper.getSqlTypePk(cld, i)); Now this seems to work too. Is the patch correct (please confirm/refuse) or were there good reasons for using stmt.setObject(...)? (This is not DB2 specific, how comes no-one else reports problems??) Thanks, Norbert. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]