Set an image for Centric CRM 4.1 (Stable and Released)

Sign In or Register

Centric CRM 4.1 (Stable and Released)

Core Team
PUBLIC PROFILE

Back to topics

File Submissions

Fixed error in DatabaseUtils.java for Oracle

You need to be logged in to post messages

Fixed error in DatabaseUtils.java for Oracle

6/22/2007 3:33 PM EDT (edited)

Using the latest 4.1 build from SVN we were receiving the generic 'CATALINA_OPTS=-Djava.awt.headless=true' error when attempting to access the Leads module. This error was traced back to the SQL query in QualifiedLeadsCounter.java. This query is modified by calling DatabaseUtils.castDateTimeToDate(db, "conversion_date"). Since we are using Oracle this function returns ("TO_DATE(" + date + ",'dd/mm/yyyy')"); In this case date is a TIMESTAMP and this was causing the error to be thrown by Oracle. Adding trunc() around the date fixes the error and should work for any future calls to DatabaseUtils.castDateTimeToDate() whether a TIMESTAMP or DATE type is input.

\src\java\org\aspcfs\utils\DatabaseUtils.java
264c264
< return ("TO_DATE(trunc(" + date + "),'dd/mm/yyyy')");
---
> return ("TO_DATE(" + date + ",'dd/mm/yyyy')");

I believe simply removing the entire TO_DATE call and just leaving "trunc(" + date + ")" would be even simpler and produce the same result.