[
https://issues.apache.org/jira/browse/METAMODEL-198?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14962443#comment-14962443
]
ASF GitHub Bot commented on METAMODEL-198:
------------------------------------------
Github user kaspersorensen commented on a diff in the pull request:
https://github.com/apache/metamodel/pull/58#discussion_r42322120
--- Diff:
jdbc/src/test/java/org/apache/metamodel/jdbc/JdbcTestTemplates.java ---
@@ -633,4 +634,84 @@ public void run(UpdateCallback callback) {
dataContext.executeUpdate(new DropTable(defaultSchema,
testTableName));
}
}
+
+ public static void timestampValueInsertSelect(Connection conn) throws
Exception {
+ assertNotNull(conn);
+
+ try {
+ // clean up, if nescesary
+ conn.createStatement().execute("DROP TABLE test_table");
+ } catch (SQLException e) {
+ // do nothing
+ }
+
+ assertFalse(conn.isReadOnly());
+
+ JdbcDataContext dc = new JdbcDataContext(conn);
+ final Schema schema = dc.getDefaultSchema();
+ final Timestamp timestamp1 = Timestamp.valueOf("2015-10-16
16:33:33.456");
+ final Timestamp timestamp2 = Timestamp.valueOf("2015-10-16
16:33:34.683");
--- End diff --
That's exactly why I want to use the JDBC escape syntax so the DB can make
such conversions itself.
> Where clauses on timestamp loses the nanoseconds
> ------------------------------------------------
>
> Key: METAMODEL-198
> URL: https://issues.apache.org/jira/browse/METAMODEL-198
> Project: Apache MetaModel
> Issue Type: Bug
> Reporter: Ankit Kumar
>
> Queries having where clause on timestamp column in databases loses the
> nanoseconds.
> This is happening because the Timestamp values are converted to Date object
> using the new Date(long timeInMilliseconds).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)