dcsimg
How can i avoid TimeStamp Exception in EJB CMP using WebSphere ApplicationServer)?
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   beula_sc
Posted On:   Thursday, April 19, 2001 09:34 PM

I am using oracle database,one column is Date ,in EJB CMP have a dataType TimeStamp(because i need date with time),when i am trying to insert the data using create method in EJB , there is no problem, but when i am trying to retrive the date using getMethods ,i am gettingExceptions: Part of Source Code: java.sql.Timestamp arlttime=new java.sql.Timestamp(2000,12,12,2,30,0,0); java.sql.Timestamp fedbkwaittime=new java.sql.Timestamp(2000,12,12,2,30,0,0); java.sql.Timestamp strttime=new java.sql.Timestamp(2000,12,12,2,30,0,0); java.sql.Timestamp exprytime=new java.sql.Timestamp(2000,12,12,2,30,0,0); EventsMaster rec1 =   More>>

I am using oracle database,one
column is Date ,in EJB CMP have a
dataType TimeStamp(because i need
date with time),when i am trying to
insert the data using create method
in EJB , there is no problem, but
when i am trying to retrive the
date using getMethods ,i am

gettingExceptions:

Part of Source Code:


java.sql.Timestamp arlttime=new java.sql.Timestamp(2000,12,12,2,30,0,0);

java.sql.Timestamp fedbkwaittime=new java.sql.Timestamp(2000,12,12,2,30,0,0);

java.sql.Timestamp strttime=new java.sql.Timestamp(2000,12,12,2,30,0,0);

java.sql.Timestamp exprytime=new java.sql.Timestamp(2000,12,12,2,30,0,0);

EventsMaster rec1 = home.create("e65", "Meeting", "M","22-02-2001 12hrs", "y", arlttime, "y","y", fedbkwaittime, strttime, exprytime, "y", 0, 0, "y", "y", "testingbean", "y", "u03");


EventsMasterPK pkMesTem=new EventsMasterPK("t01");

EventsMaster rec=home.findByPrimaryKey(pkMesTem);


System.out.println("EventID by status" + rec.getEventID() );

System.out.println("Description " + rec.getEventDesc());

System.out.println("Event Type " + rec.getEventType());

Enumeration c;

try

{

c=home.findByStatus("y");


System.out.println("Record where status= true");

while(c.hasMoreElements())

{

EventsMaster rec2=(EventsMaster)c.nextElement();

System.out.println("EventID by status" + rec2.getEventID() );

System.out.println("Description by status " + rec2.getEventDesc() );

System.out.println("Event Type by status" + rec2.getEventType());


}

}

catch(Exception e1)

{

System.out.println("Error string " + e1.getMessage() );


}





Exceptions:

java.rmi.ServerException:
RemoteException occurred in server
thread; nested exception is:
com.ibm.ejs.persistence.EJSPersistenceException:
java.lang.IllegalArgumentException:
Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff;
nested exception is:
java.lang.IllegalArgumentException:
Timestamp format must be yyyy-mm-dd hh:mm:ss.fffffffff
same source coding is working fine in weblogic, in WebSphere it is creating the problem

Please help me out

   <<Less
About | Sitemap | Contact