From 71588514ffd530e2995eb876fca16008bb3ada0c Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sun, 1 Jul 2012 10:34:27 +0200 Subject: [PATCH] [#1253] Avoid JDBC escape syntax for date/time literals - fix for Sybase ASE --- jOOQ/src/main/java/org/jooq/impl/Val.java | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/Val.java b/jOOQ/src/main/java/org/jooq/impl/Val.java index 1eeca1feaa..82c4c9f0b4 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Val.java +++ b/jOOQ/src/main/java/org/jooq/impl/Val.java @@ -372,14 +372,9 @@ class Val extends AbstractField implements Param { // escape syntax else if (type == Date.class) { -// // Sybase ASE needs explicit casting to DATE -// if (dialect == ASE) { -// context.sql(field("{d '" + val + "'}").cast(Date.class)); -// } - // The SQLite JDBC driver does not implement the escape syntax // [#1253] SQL Server and Sybase do not implement date literals - if (asList(SQLITE, SQLSERVER, SYBASE).contains(dialect)) { + if (asList(ASE, SQLITE, SQLSERVER, SYBASE).contains(dialect)) { context.sql("'").sql(val.toString()).sql("'"); } @@ -395,14 +390,9 @@ class Val extends AbstractField implements Param { } else if (type == Timestamp.class) { -// // Sybase ASE needs explicit casting to DATETIME -// if (dialect == ASE) { -// context.sql(field("{ts '" + val + "'}").cast(Timestamp.class)); -// } - // The SQLite JDBC driver does not implement the escape syntax // [#1253] SQL Server and Sybase do not implement timestamp literals - if (asList(SQLITE, SQLSERVER, SYBASE).contains(dialect)) { + if (asList(ASE, SQLITE, SQLSERVER, SYBASE).contains(dialect)) { context.sql("'").sql(val.toString()).sql("'"); } @@ -425,7 +415,7 @@ class Val extends AbstractField implements Param { // The SQLite JDBC driver does not implement the escape syntax // [#1253] SQL Server and Sybase do not implement time literals - if (asList(SQLITE, SQLSERVER, SYBASE).contains(dialect)) { + if (asList(ASE, SQLITE, SQLSERVER, SYBASE).contains(dialect)) { context.sql("'").sql(val.toString()).sql("'"); }