Hi Jamie and the other friends,
I'm posting my code and shows I'm reading submittedDate from table bug and I have to write it to new table exactly like bug table just submittedDate it's column type is Date(the old one submittedDate was varchar(20))
Could you please help me how can I implement this part (I mean write in new table?)
Time is really tied up and appreciate for your help like always...
Many thanks,
Elahe
[code]
....
rs =stmt.executeQuery("select bugNumber,submittedDate from bug ");
String strWork;
Date dateWork;
String strPutBack;
//* Format the Date
SimpleDateFormat formatter = new SimpleDateFormat("M/d/yy");
while (rs.next()) {
strWork = rs.getString(2);
dateWork = null;
/*parse to Date*/
try {
long l = Date.parse( strWork );
dateWork = new Date(l);
}
catch( Exception x ) {
strPutBack = "-";
}
try {
strPutBack = formatter.format(dateWork);
System.out.println( "was string "+ strWork + " new date "+ strPutBack );
}
catch( Exception x ) {
}
}
}
catch( SQLException x ) {
}
catch( Exception x ) {
}
...