posted 14 years ago
What exactly do you mean with "output is: 2008-01-19"? Where do you see that; somewhere in the database, where you're looking at what's in the database with some program? Or are you just doing System.out.println(sqltDate);?
If you're doing the latter: Date objects (java.util.Date as well as java.sql.Date) do not remember what format they are in. When you want to show them in a specific format, you have to format them yourself using, for example, a SimpleDateFormat object.