1
There is a way to query the database date/time without using activate query?
On the Oracle I do this:
SQLQuery qry = session.createSQLQuery("SELECT SYSDATE FROM dual");
But I would like a general query to not get price to the database.
1
There is a way to query the database date/time without using activate query?
On the Oracle I do this:
SQLQuery qry = session.createSQLQuery("SELECT SYSDATE FROM dual");
But I would like a general query to not get price to the database.
1
Try this query:
SQLQuery query = session.createSQLQuery("SELECT CURRENT_DATE");
Thanks for your attention, but this query is native and works for postgres and maybe for mysql, but not on Oracle. I am looking for a JPQL query instead of a query
@Demyscota There actually is this in JPA, but apparently it can only be used in comparisons. See uauHebert’s website.
Thank you very much for the comment, for what I saw I will have to settle for the same query Native.
Browser other questions tagged java database hibernate jpa
You are not signed in. Login or sign up in order to post.
Do you need to use sysdate even? Can’t pick up the date using
new Date()
, orCalendar.getInstance();
? 'Cause then you wouldn’t really be stuck in the bank.– humungs
Yes friend, I need to try to recover from the data set the date.
– Cota