John McNally <[EMAIL PROTECTED]> writes: > I believe the patch was to remove the override from DBOracle as the jdbc > escape approach used in DB works.
Yeah, here's the latest diff: Index: DBOracle.java =================================================================== RCS file: /home/cvs/jakarta-turbine-torque/src/java/org/apache/torque/adapter/DBOracle.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -u -r1.10 -r1.11 --- DBOracle.java 18 Mar 2002 07:59:02 -0000 1.10 +++ DBOracle.java 21 Mar 2002 16:40:18 -0000 1.11 @@ -72,13 +72,11 @@ * @author <a href="mailto:[EMAIL PROTECTED]">Brett McLaughlin</a> * @author <a href="mailto:[EMAIL PROTECTED]">Bill Schneider</a> * @author <a href="mailto:[EMAIL PROTECTED]">Daniel Rall</a> - * @version $Id: DBOracle.java,v 1.10 2002/03/18 07:59:02 dlr Exp $ + * @version $Id: DBOracle.java,v 1.11 2002/03/21 16:40:18 dlr Exp $ */ public class DBOracle extends DB { - private static final String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss"; - /** * Empty constructor. */ @@ -226,39 +224,5 @@ public boolean escapeText() { return false; - } - - /** - * This method is used to format any date string using Oracle's - * <code>TO_DATE</code> built-in function. - * - * @see org.apache.torque.adapter.DB#getDateString(String) - * @deprecated use getDateString(java.util.Date) - */ - public String getDateString(String dateString) - { - return formatDate(dateString); - } - - /** - * This method is used to format any date string. - * Database can use different default date formats. - * - * @return The proper date formated String. - */ - public String getDateString(Date date) - { - return formatDate(new SimpleDateFormat(DATE_FORMAT).format(date)); - } - - /** - * This method is used to format any date string using Oracle's - * <code>TO_DATE</code> built-in function. - */ - private final String formatDate(String date) - { - char delim = getStringDelimiter(); - return ("TO_DATE(" + delim + date + delim + ", " + delim + - "yyyy-mm-dd hh24:mi:ss" + delim + ')'); } } And associated commit log: revision 1.11 date: 2002/03/21 16:40:18; author: dlr; state: Exp; lines: +1 -37 With prompting from Fedor, Bill Schneider <[EMAIL PROTECTED]> has run tests for us which show that standard JDBC escapes work in Oracle: > > If Oracle has problems _with_ JDBC escapes it means that the > > driver is not JDBC compliant (I think this is unlikely). Could > > Oracle users check that? > > Bill, did you try using the default implementation of > getDateString(Date) from DB.java (in the same adapters package)? the default implementation in DB.java actually works, I've found. Oracle lets you do {ts ' ... '} escapes, which I didn't know was part of the JDBC spec. The original DBOracle was broken because it overrode the default method with one that didn't work. -- Bill -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
