Monday, June 18, 2018

Cannot cast java.util.date to java.sql.date

I have the following code snippet where i get continous error for casting java.util.date to java.sql.date.



        SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy");

storedProcedureCall.setLong(1, 12345);

storedProcedureCall.setDate(2, (java.sql.Date) sdf.parse("09/02/2017"));
storedProcedureCall.setDate(3, (java.sql.Date) sdf.parse("10/02/2017"));


What am i doing wrong here. I have imported the java.util.Date package as well.

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...