diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java index 7cdd9da24..16a880d00 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java @@ -153,6 +153,7 @@ public class DBDictionary public int maxIndexNameLength = 128; public int maxIndexesPerTable = Integer.MAX_VALUE; public boolean supportsForeignKeys = true; + public boolean supportsTimestampNanos = true; public boolean supportsUniqueConstraints = true; public boolean supportsDeferredConstraints = true; public boolean supportsRestrictDeleteAction = true; @@ -1040,7 +1041,11 @@ public class DBDictionary val.setTime(val.getTime() + 1000); nanos = 0; } - val.setNanos(nanos); + + if (supportsTimestampNanos) + val.setNanos(nanos); + else + val.setNanos(0); if (cal == null) stmnt.setTimestamp(idx, val);