Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Mon, 19 Mar 2007 07:53:34 -0400
shivaraj wrote:
In my JAVA code I have a string in "15:45 03/17/2007" this format.
Could any one let me know how can i insert/update it on to sql
database where the column is of type datetime ? If any one has a
sample code to do this, that will be great.
Use SimpleDateFormat parse to convert your string to a
java.util.Date and use a PreparedStatement for using
it in SQL (you need to wrap it in a java.sql.TimeStamp, but that
is trivial).
Arne
.
- Follow-Ups:
- References:
- Prev by Date: Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- Next by Date: Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- Previous by thread: Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- Next by thread: Re: how to convert JAVA string in "hh:mm dd/mm/yyyy" to sql datetime format?
- Index(es):
Relevant Pages
|