Hi, Iam struck with the following, please help me. After accepting date from a JSP page in the form of String, I want it to be stored into the data-base using EntityBean. The corresponding fields in Oracle are DATE (sql data-type) and java.sql.Date in my CMP field. Now the problem was do I convert the accepted date to java.sql.Date, which I did by using java.sql.Date.parse("accepted date from JSP"); But Iam getting exception when I try to insert it into the Data-base. What is the solution to this problem?? Is there any other solution to "insert a into a Data-base using an entity-bean" ??
posted 10 years ago
when Entity Beans deal with Date or Time values, they must be converted into long values. Additionally, finder or select methods cannot work with date objects either. You have to use the appropriate long value instead.
Marco Barenkamp<br />_ _ _ _ _ ________________________ _ _ _ _ _ <br />L M I N T E R N E T S E R V I C E S AG<br /> <br />Head of Software Development<br /> <br /> <br />BEA Certified Enterprise Developer<br />Sun Certified Programmer for the Java2 Platform<br />Sun Certified Web Component Developer for the Java2 Platform<br />Sun Certified Developer for the Java 2 Platform <br />Sun Certified Business Component Developer for the Java 2 Platform <br />Sun Certified Enterprise Architect for the Java 2 Platform Enterprise Edition<br /> <br />LMIS AG