Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

sql date parsing  RSS feed

 
pavan mane
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
i need to parse the following date String -"2006-03-20 00:00:00.0" to java.sql.Date

i have been trying a lot of ways but without success please help
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced question. Moving...
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, so show us what you tried and why that didn't work. Did you get compile or runtime errors? Copy and paste the error code along with your source code.

Hint: You can use class java.text.SimpleDateFormat to parse the string into a java.util.Date, and you can convert this into a java.sql.Date like this:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!