Skip to main content

All Questions

Filter by
Sorted by
Tagged with
1 vote
1 answer
2k views

java.sql.Timestamp to Date Conversion in Oracle SQL

I have run into this weird Timestamp to Date Conversion issue in Oracle SQL. Here is the SQL statement: String INSERT_SQL = String.format("INSERT INTO AUDIT_TASK (%s, %s, %s, %s) VALUES (...
rightCoder's user avatar
1 vote
2 answers
1k views

DateField Vaadin Component with SQL Date

So, I have a property SQL.Date in my POJO class. I want to bind it using Binder from Vaadin Component, but always returned like this: Property type 'java.sql.Date' doesn't match the field type 'java....
Aroli Marcellinus's user avatar
0 votes
2 answers
4k views

Parsing SQLDate, java.util.Date and LocalDate

I'm very confused working with dates could someone point me in the right direction on for the code below, it throws the following exception: org.h2.jdbc.JdbcSQLException:Invalid value '11' for ...
Ashford Tulgaa's user avatar
0 votes
2 answers
3k views

SQL between two dates statement using java string

I'm trying to collect data from a table and then run a between two dates statement. The statement is created in a java string and then used by a resultSet variable using statement.executeQuery() with ...
Nick Karaolis's user avatar
0 votes
2 answers
171 views

Java date to sql date

How can I store a specific date from java to my database? (Not only the date today, but also some dates that the user wants to specifiy) try { SimpleDateFormat dateFormat = new ...
meatno's user avatar
  • 19
19 votes
2 answers
31k views

Converting java.sql.Date & java.util.Date to org.joda.time.LocalDate

I am trying to carefully and meticulously clean up some of my older (production) code. One thing I am trying to do is convert all my usages of java.util.Date to LocalDate and DateTime. However, I ...
ryvantage's user avatar
  • 13.5k
9 votes
3 answers
27k views

How to parse String to java.sql.date

I have a String String s = "01 NOVEMBER 2012"; Then I want parse it to sqlDate. And insert it into the database. Is it possible to parse that string to sqlDate?!?! Yup, sql date format is "yyyy-...
Jason Amavisca's user avatar
0 votes
1 answer
96 views

Is there a Java lib that can evaluate SQL style date functions from a String?

I'm looking for a way to read a date command from a text file and evaluate it. As an example consider this MySQL command: DATE_SUB(CURDATE(), INTERVAL 1 MONTH) Something similar to that will be in ...
CrazyPenguin's user avatar