From 20c933b1c95b173cd450054f5ca820bc4c9bf251 Mon Sep 17 00:00:00 2001 From: moparisthebest Date: Wed, 16 May 2018 23:52:21 -0400 Subject: [PATCH] Fix postgresql test --- .../java/com/moparisthebest/jdbc/QueryMapperTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java b/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java index c172544..fb5179e 100644 --- a/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java +++ b/test/src/test/java/com/moparisthebest/jdbc/QueryMapperTest.java @@ -134,12 +134,12 @@ public class QueryMapperTest { } catch(Exception e) { // ignore, means the database hasn't been set up yet } - if(isWrapperFor(conn, "org.apache.derby.impl.jdbc.EmbedConnection")) { - // derby doesn't support DATETIME - qm.executeUpdate("CREATE TABLE person (person_no NUMERIC, first_name VARCHAR(40), last_name VARCHAR(40), birth_date TIMESTAMP)"); - } else { + if(isWrapperFor(conn, "com.microsoft.sqlserver.jdbc.SQLServerConnection")) { // mssql doesn't support inserting into TIMESTAMP qm.executeUpdate("CREATE TABLE person (person_no NUMERIC, first_name VARCHAR(40), last_name VARCHAR(40), birth_date DATETIME)"); + } else { + // derby doesn't support DATETIME + qm.executeUpdate("CREATE TABLE person (person_no NUMERIC, first_name VARCHAR(40), last_name VARCHAR(40), birth_date TIMESTAMP)"); } qm.executeUpdate("CREATE TABLE boss (person_no NUMERIC, department VARCHAR(40))"); qm.executeUpdate("CREATE TABLE val (val_no NUMERIC, num_val NUMERIC, str_val VARCHAR(40))");