Advertisement

06.04.2008 at 11:56AM PDT, ID: 23457892
[x]
Attachment Details

How can I format java.sql.Date ?

Asked by arkhls in Java Programming Language

Tags: Java

I'm trying to save  java.sql.Date with   "MM/dd/yyyy"  , by defult  sql.date() is  saved in DB by
 "yyyy-MM-dd"

example ->    java.sql.date sqlDate = 2008-05-26
I want to save above Sqldate in "dd/mm/yyyy"  in Database  like this     06/05/2008
I tried these line  
SimpleDateFormat formatter = new SimpleDateFormat("dd/MM/yyyy");
String toDaySt = formatter.format(new java.util.Date() );
java.sql.Date sqlDate =    java.sql.Date.ValueOf( toDaySt) ;

but I get this the exception :

Exception in thread "main" java.lang.IllegalArgumentException
      at java.sql.Date.valueOf(Unknown Source)
      at dateTest.main(dateTest.java:47)

does anybody have any idea ? Many Thanks Start Free Trial
[+][-]06.04.2008 at 11:59AM PDT, ID: 21712974

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 12:17PM PDT, ID: 21713153

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 03:02PM PDT, ID: 21714560

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 03:07PM PDT, ID: 21714592

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 03:57PM PDT, ID: 21714948

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 05:29PM PDT, ID: 21715584

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 05:36PM PDT, ID: 21715618

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.04.2008 at 11:25PM PDT, ID: 21716770

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: Java
Sign Up Now!
Solution Provided By: CEHJ
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.25.2008 at 05:24PM PDT, ID: 21870938

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.25.2008 at 05:27PM PDT, ID: 21870944

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.26.2008 at 01:01AM PDT, ID: 21872569

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628