Hi there, I jus want to store a
string(date) into the ORACLE.I jus get the string(date) from the textfield and when i store it in SQL i get the error invalid month.I will post the code here..
the error is:java.sql.SQLException: ORA-01843: not a valid month
ORA-02063: preceding line from CSE3231B
try
{
SimpleDateFormat sdfInput = new SimpleDateFormat( "dd/mm/yyyy" );
SimpleDateFormat sdfOutput = new SimpleDateFormat ( "dd-mm-yyyy" );
Date date = null;
String s4 = (String) jTextField2.getText();
date = sdfInput.parse(s4);
stmt.executeUpdate(" insert into sales@cse3231b values ('"+s1+"','"+s2+"','"+sdfOutput.format(date)+"')");
}
catch{
}