longzenvo / log4jdbc

Automatically exported from code.google.com/p/log4jdbc
0 stars 0 forks source link

Time get printed in the log although the query should use only the Date part of the query #38

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a JPQL query with a parameter 
         .setParameter("mydate", date, TemporalType.DATE)
Using "between" JPQL operator between two dates mapped as java.sql.date (no 
time, date only)
2. Execute the query

What is the expected output? What do you see instead?

select * as col_0_0_ from A_COL_DATE cutoff0_ where to_date('06/30/2011 
14:56:38', 'mm/dd/yyyy hh24:mi:ss') between cutoff0_.DATE_START and 
cutoff0_.DATE_END ) where rownum <= 2 {executed in 7 msec}

Although the query is really executed ignoring the time part, using only the 
date.

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by voloth...@gmail.com on 4 Jul 2011 at 1:05

GoogleCodeExporter commented 9 years ago
Hibernate Core 3.3.2-GA
Specification-Title:    Oracle JDBC driver classes for use with JDK14
Created-By: 1.4.2_14 (Sun Microsystems Inc.)

Original comment by voloth...@gmail.com on 4 Jul 2011 at 1:07

GoogleCodeExporter commented 9 years ago
I'm wondering if it just shows wrong in the log since it seems to format in 
there as '08/06/2011 23:59:59.000', as an example.  That's not a valid format 
to query off of, at least for MySQL, but it gets results just fine when the 
query actually executes.

Original comment by ke...@kjordan.net on 15 Aug 2011 at 2:55

GoogleCodeExporter commented 9 years ago
Is there a way to format printed dates ? I'm using Oracle and I'm also in need 
to copy and paste outputted query to Oracle, but '06/30/2011 14:56:38.000' is 
not a valid format. My schema configuration (NLS) is set to french, and I would 
like something like '30/06/2011 14:56:38'.

Any progress on this issue ?

Original comment by Makaveli...@gmail.com on 12 Aug 2014 at 9:04