Bluehost.com Web Hosting $6.95

how to convert yyyy-MM-dd HH:mm:ss to java.sql.Date

This is a discussion on how to convert yyyy-MM-dd HH:mm:ss to java.sql.Date within the MySQL Database forums, part of the Database Forums category; hi, how to convert date in this format yyyy-MM-dd HH:mm:ss to java.sql.Date if i ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-02-2007
sh
 
Posts: n/a
Default how to convert yyyy-MM-dd HH:mm:ss to java.sql.Date


hi,

how to convert date in this format yyyy-MM-dd HH:mm:ss to
java.sql.Date



if i use directly like this java.sql.Date.valueOf(processDate)

am getting exception java.lang.NumberFormatException: For input
string: "02 19:51:51"


if anybody knows reply back immedietely.

thanks in advance

Reply With Quote
  #2 (permalink)  
Old 03-02-2007
Captain Paralytic
 
Posts: n/a
Default Re: how to convert yyyy-MM-dd HH:mm:ss to java.sql.Date

On 2 Mar, 14:30, "sh" <shailajabt...@gmail.com> wrote:
> hi,
>
> how to convert date in this format yyyy-MM-dd HH:mm:ss to
> java.sql.Date
>
> if i use directly like this java.sql.Date.valueOf(processDate)
>
> am getting exception java.lang.NumberFormatException: For input
> string: "02 19:51:51"
>
> if anybody knows reply back immedietely.
>
> thanks in advance


See:
http://java.sun.com/j2se/1.4.2/docs/...va.lang.String)
Looks like you need to take only the date part.

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 05:37 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0