EJB Entity CMP and Oracle Date

Discussions

EJB programming & troubleshooting: EJB Entity CMP and Oracle Date

  1. EJB Entity CMP and Oracle Date (2 messages)

    Hi everyone, I'm working with (EJB 2.1) Entities CMP and Oracle, and I have a problem... I'm trying to insert a java.util.Date (Date and Time) into a Date field in Oracle... but it doesn't work... It just accept java.sql.Date but the time as we know is not stored.... just the day... Then I tried the converters between a Database Date and a TimeStamp.... buuuuuuuuuut.. It's still storing only the day.... :'( I'm developing with Websphere 6 and Oracle 9/10... I hope anyone of you help me... any idea for solve this? The converters that I have used in order to solve this are: 1) VapDateToTimestampConverter Converts a database Date to and from a Timestamp. (Time is not stored) 2) VapTimestampToUtilDateConverter Convert a database java.sql.Timestamp to and from a java.util.Date. (Websphere doesn't allow timestamp for oracle) Thanks! Ing. Guillermo JPC SCJP/SCWCD
  2. Now i have got this exception: ------------------------------------------------------------ Deployment from com.ibm.etools.ejbdeploy.EJBDeployer had errors: Could not find type map for attribute 'fecha_asignacion'. (No type mapping defined for java.util.Date to DATE) com.ibm.etools.ejbdeploy.UserCorrectableEJBDeployError: Could not find type map for attribute 'fecha_asignacion'. (No type mapping defined for java.util.Date to DATE) at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.getException(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.visit(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.doExecute(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.execute(Unknown Source) at com.ibm.wtp.j2ee.deploy.J2EEDeployOperation.deploy(Unknown Source) at com.ibm.wtp.j2ee.deploy.J2EEDeployOperation.execute(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation.doRun(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation$1.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation.run(Unknown Source) at com.ibm.wtp.common.operation.WTPOperationJobAdapter.run(Unknown Source) at org.eclipse.core.internal.jobs.Worker.run(Unknown Source) Deployment from com.ibm.etools.ejbdeploy.EJBDeployer had errors: Could not find type map for attribute 'fecha_asignacion'. (No type mapping defined for java.util.Date to DATE) com.ibm.etools.ejbdeploy.UserCorrectableEJBDeployError: Could not find type map for attribute 'fecha_asignacion'. (No type mapping defined for java.util.Date to DATE) at com.ibm.etools.ejbdeploy.plugin.EJBDeployOperation.getException(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.visit(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.doExecute(Unknown Source) at com.ibm.etools.ejbdeploy.EJBDeployer.execute(Unknown Source) at com.ibm.wtp.j2ee.deploy.J2EEDeployOperation.deploy(Unknown Source) at com.ibm.wtp.j2ee.deploy.J2EEDeployOperation.execute(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation.doRun(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation$1.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at org.eclipse.core.internal.resources.Workspace.run(Unknown Source) at com.ibm.wtp.common.operation.WTPOperation.run(Unknown Source) at com.ibm.wtp.common.operation.WTPOperationJobAdapter.run(Unknown Source) at org.eclipse.core.internal.jobs.Worker.run(Unknown Source) Deployment from com.ibm.etools.webservice.was.deployer.WSDeployer completed successfully ---------------------------------------
  3. Hello there, I had exactly the same problem recently and after lot of reading and trying I was finally able to fix it but still don't know the reason yet. Try this: Open the specific tblxmi file for that table under ejbModule/../../backend/ORACLE_V8_1 folder and for that particular column make sure the SQLTimestamp is 3 instead of 1 (default) Here is what I have: under the TIMESTAMP column, save and generate it. It should work. Jawad Ann Arbor, MI