• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

insert LocalDateTime argument to PostgreSQL-query parameter

 
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
     Greetings to all!
     Further the code with problem:


   I want to insert startDateTime and endDateTime .in ???-values in query.  

   Parameter datetime is has Timestamp-type.

   I tried to use that


  but without success...
 
Bartender
Posts: 3668
151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I looked up how a datetime looks in PostGreSQL, and I tried

and it looks good.
 
Master Rancher
Posts: 4370
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you insert those two values into your SQL?
 
Andrey Dmitriev
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dave Tolls wrote:How did you insert those two values into your SQL?



by using  org.springframework.jdbc.core.JdbcTemplate
 
Dave Tolls
Master Rancher
Posts: 4370
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since the above code in your first post doesn't work (that's invalid SQL for example) can you show us the code that you actually tried.

because you should simply be able to bind the Timestamps in in the same way the id is bound.


WHERE user_id=? AND datetime BETWEEN ? AND ? ORDER BY datetime
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!