From: Boris T. <BTa...@re...> - 2002-09-04 18:05:23
|
So java.lang.Short can't be mapped with CMP2 for Oracle? It is strange. I tried to replace jdbc-type with INTEGER, but it doesn't work as well. I don't wont to change existing code: replace java.lang.Short type with Integer, because it is already works with mySQL and MSSQL databases fine. We just need to add support to Oracle. BTW, I have the Oracle 9i version of classes12.jar in lib directory Anyone knows how to resolve this issue with supporting java.lang.Short in CMP2? I have tried to search in forum archives without success. Dan, may be You can help? Thanks, Boris From: "Saroj Kumar" <kum...@wi...> To: <jbo...@li...> Subject: RE: [JBoss-user] CMP2 java.lang.Short mapping for Oracle 9i Date: Wed, 4 Sep 2002 10:42:02 +0530 Organization: wipro Reply-To: jbo...@li... Try INTEGER. -----Original Message----- From: jbo...@li... [mailto:jbo...@li...] On Behalf Of Boris Tamarkin Sent: Wednesday, September 04, 2002 3:44 AM To: 'jbo...@li...' Subject: [JBoss-user] CMP2 java.lang.Short mapping for Oracle 9i What correct mapping for "java.lang.Short" should be for Oracle 9i in standardjbosscmp-jdbc.xml file? I have tried <java-type>java.lang.Short</java-type> <jdbc-type>NUMERIC</jdbc-type> <sql-type>NUMBER(5)</sql-type> also <java-type>java.lang.Short</java-type> <jdbc-type>SMALLINT</jdbc-type> <sql-type>SMALLINT</sql-type> also <java-type>java.lang.Short</java-type> <jdbc-type>NUMERIC</jdbc-type> <sql-type>SMALLINT</sql-type> also <java-type>java.lang.Short</java-type> <jdbc-type>SMALLINT</jdbc-type> <sql-type>NUMBER(5)</sql-type> and no success. I got java.lang.ClassCastException in ejbCreate(..., java.lang.Short arg, ....). It happens when using CMP2 on JBoss3.0.0-tomcat4.0.3. Also I tried both SMALLINT and Number(5) types for column in table in Oracle 9i database that corresponds to Short type. with all combinations above. Will appreciate help. Thanks, Boris ********* 14:25:57,104 ERROR [ScheduleTask] Could not create entity java.lang.ClassCastException: java.lang.Short at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedSt atement.java:2351) at oracle.jdbc.driver.OraclePreparedStatement.setObject(OraclePreparedSt atement.java:2449) at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.setObjec t(LocalPreparedStatement.java:607) at org.jboss.ejb.plugins.cmp.jdbc.JDBCUtil.setParameter(JDBCUtil.java:15 6) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setA rgumentParameters(JDBCAbstractCMPFieldBridge.java:283) at org.jboss.ejb.plugins.cmp.jdbc.bridge.JDBCAbstractCMPFieldBridge.setI nstanceParameters(JDBCAbstractCMPFieldBridge.java:262) at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.insertEntity(J DBCCreateEntityCommand.java:192) at org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.execute(JDBCCr eateEntityCommand.java:131) at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.createEntity(JDBCStor eManager.java:450) at org.jboss.ejb.plugins.CMPPersistenceManager.createEntity(CMPPersisten ceManager.java:253) at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.crea teEntity(CachedConnectionInterceptor.java:270) at org.jboss.ejb.EntityContainer.createLocalHome(EntityContainer.java:57 9) ......... at org.jboss.ejb.plugins.local.LocalHomeProxy.invoke(LocalHomeProxy.java :110) at $Proxy85.create(Unknown Source) at com.rendition.appserver.ScheduleTaskManagementEJB.addScheduleTaskInte rnal(ScheduleTaskManagementEJB.java:248) ......... |