dcsimg
How to insert data&time to Database date field
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   mohan_seenippandian
Posted On:   Tuesday, April 8, 2003 08:07 PM

Dear Friends,

I have created a Stored Procedure which takes a Date data type as an input,When i call this procedure from java i need to set the data&time in
yyyymmddhhmmss format. How to set this from java ?.

Rgds
Mohan S

Re: How to insert data&time to Database date field

Posted By:   Jonathan_Downey  
Posted On:   Thursday, April 10, 2003 02:13 AM

Use a Date Formatter to create the string needed and pass that to the stored proceedure.


public String formatDate(Date d) {
SimpleDateFormat df = (SimpleDateFormat)DateFormat.getInstance();

df.applyPattern("yyyyMMddHHmmss");
return df.format(d);
}

I'm afraid I've never called Stored Procedures in a DB, so this is all I can help with. Sorry.

Jonathan

About | Sitemap | Contact