how to set the datetime value using preparedstatement?
hi,
i want to set the string value which contains the date and time i wanted to set this string value in MSSql server database table one field datatype is datetime.
i am unable to perform this operation,
i am getting the error like
**** SQLException Error Code: 0
**** SQLException Error Message: [Microsoft][SQLServer 2000 Driver for JDBC]Valu
e can not be converted to requested type.
SimpleDateFormat sdfInput = new SimpleDateFormat( "yyyy/MM/dd" );
SimpleDateFormat sdfOutput =new SimpleDateFormat ( "MM/dd/yyyy" );
String textDate = contentDashBoard.getDateTimeStampReceived();
java.util.Date date = sdfInput.parse( textDate );
java.sql.Timestamp ts = new java.sql.Timestamp(date.getTime());
ps.setTimestamp(4,ts);

