Problem with Date fields while fetchin back
i m having a problem with dates less that 01-01-1945, i am using Websphere 6.0 application server and DB2 databast, when i insert a date , then it is getting inserted fine but while fetching back it is gving me null, it worked fine with Websphere 5.0. The same problem persista in Tomcat 4.1 & Tomcat 5.5 also. Any direction will be greatly helpfull.....
[365 byte] By [
Funnya] at [2007-10-3 3:39:48]

> The value is getting inserted, but it is not fetching
> it properly.
I have many doubt about it.
> even as you say the value is not getting inserted
> then also it is a problem
Perhaps the field will not accept a date earlier then the one you are describing. I would look into that.
here are my insert and fetch SQL query statements, i m using prepared statements
insert
strInsertQuery = INSERT INTO TDV_USER(" +"MEMBER_ID,"+"USER_ID,"+"TITLE,"+
"FIRST_NM,"+
"MI,"+"LAST_NM,"+
"DOB"+
" VALUES(?,?,?,?,?,?,?)"
stmt=conn.prepareStatement(strInsertQuery);
i=stmt.executeUpdate();
select query
strQueryProgram= "SELECT "+"MEMBER_ID,"+"USER_ID,"+"TITLE,"+"FIRST_NM,"+"MI,"+"LAST_NM,"+"DOB from tdv_user" ;
objPreparedStatement=conn.prepareStatement(strQueryProgram);
rs=objPreparedStatement.executeQuery();
hope this will help a bit to trace the error i m facing
Funnya at 2007-7-14 21:35:18 >

here is what i set into the query
for select
userVO = new UserVO ();
iCount = 1;userVO.setStrMember_Id(rs.getString(iCount++));userVO.setStrUserId(rs.getString(iCount++));
userVO.setStrTitle(rs.getString(iCount++));userVO.setStrFirst_Nm(rs.getString(iCount++));
userVO.setStrMI(rs.getString(iCount++));
userVO.setStrLast_Nm(rs.getString(iCount++));
userVO.setStrGender(rs.getString(iCount++));
userVO.setDtDOB(rs.getDate(iCount++));
for insert
stmt.setString(iCount++,objUserVO.getStrMember_Id());stmt.setString(iCount++,objUserVO.getStrUserId());
stmt.setString(iCount++,objUserVO.getStrTitle());
stmt.setString(iCount++,objUserVO.getStrFirst_Nm());
stmt.setString(iCount++,objUserVO.getStrMI());
stmt.setString(iCount++,objUserVO.getStrLast_Nm());
stmt.setString(iCount++,objUserVO.getStrGender());
if(objUserVO.getDtDOB()!=null)stmt.setDate(iCount++,new java.sql.Date(objUserVO.getDtDOB().getTime()));
else
stmt.setDate(iCount++,null);
Funnya at 2007-7-14 21:35:18 >
