Hey guys
I am having trouble inserting a record into oracle using JSP. The error is related to the date fields. The exact error is
"javax.servlet.ServletException: ORA-01843: not a valid month".
Now here is how I am making the date
Date today1 = new Date();
int thisDay = today1.getDate();
int thisMonth = today1.getMonth()+1;
int thisYear = today1.getYear()+1900;
String goodDate = thisMonth+"/"+thisDay+"/"+thisYear;
and here is how I am inserting it
String insertQuery = "INSERT INTO JOB_REQUISITION("
+ "JBR_DEPT_TBLGRPCD, "
+ "JBR_UNITNO, "
+ "JBR_SEQ_NBR, "
+ "JBR_REQUEST_ID, "
+ "JBR_REQUEST_DT, "
+ "JBR_STS_CD, "
+ "JBR_STS_DT, "
+ "JBR_JOB_ORG_ID, "
+ "JBR_JOB_TBLGRPCD, "
+ "JBR_JOB_CLASS, "
+ "JBR_LST_UPDT_IP_ADDR, "
+ "JBR_LST_UPDT_ID, "
+ "JBR_LST_UPDT_TS) VALUES('"
+ dptGrpCode + "', '"
+ department + "', "
+ nextJobReqNum + ", '"
+ ofcLogin.getEscUser() + "', '"
+ goodDate + "', 'OP', '"
+ goodDate + "', '"
+ organization + "', '"
+ jobGrpCode + "', '', '"
+ remoteIp + "', '"
+ ofcLogin.getEscUser() + "', '"
+ goodDate + "')";
As you can see, I am trying to insert a date at 3 points. I dont understand why Oracle doesnt like the month??? Any thoughts??
Thanks
I am having trouble inserting a record into oracle using JSP. The error is related to the date fields. The exact error is
"javax.servlet.ServletException: ORA-01843: not a valid month".
Now here is how I am making the date
Date today1 = new Date();
int thisDay = today1.getDate();
int thisMonth = today1.getMonth()+1;
int thisYear = today1.getYear()+1900;
String goodDate = thisMonth+"/"+thisDay+"/"+thisYear;
and here is how I am inserting it
String insertQuery = "INSERT INTO JOB_REQUISITION("
+ "JBR_DEPT_TBLGRPCD, "
+ "JBR_UNITNO, "
+ "JBR_SEQ_NBR, "
+ "JBR_REQUEST_ID, "
+ "JBR_REQUEST_DT, "
+ "JBR_STS_CD, "
+ "JBR_STS_DT, "
+ "JBR_JOB_ORG_ID, "
+ "JBR_JOB_TBLGRPCD, "
+ "JBR_JOB_CLASS, "
+ "JBR_LST_UPDT_IP_ADDR, "
+ "JBR_LST_UPDT_ID, "
+ "JBR_LST_UPDT_TS) VALUES('"
+ dptGrpCode + "', '"
+ department + "', "
+ nextJobReqNum + ", '"
+ ofcLogin.getEscUser() + "', '"
+ goodDate + "', 'OP', '"
+ goodDate + "', '"
+ organization + "', '"
+ jobGrpCode + "', '', '"
+ remoteIp + "', '"
+ ofcLogin.getEscUser() + "', '"
+ goodDate + "')";
As you can see, I am trying to insert a date at 3 points. I dont understand why Oracle doesnt like the month??? Any thoughts??
Thanks