From: Imran B. <Imran@eRunway.com> - 2001-11-10 18:01:46
|
Hi has any one out there used the LIKE condition when customizing the finders in JAWS. I have this finder: <finder> <name>findByFirstNameAny</name> <query> FIRST_NAME LIKE '%{0}%' </query> <order></order> </finder> But the SQL statement which JAWS interprets; [JAWS] findByFirstNameAny command executing: SELECT CONTRACTOR_USERS.USER_ID FROM CONTRACTOR_USERS where FIRST_NAME LIKE '%?%' [JAWS] Set parameter: idx=1, jdbcType=VARCHAR, value='dd' throws an Error which lookis like: [JAWS] java.sql.SQLException: Cannot convert class java.lang.String to SQL type requested [JAWS] at org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:930) [JAWS] at org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:936) [JAWS] at org.jboss.pool.jdbc.PreparedStatementInPool.setObject(PreparedStatementInPoo l.java:282) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setParameter(JDBCCommand.java:33 4) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCDefinedFinderCommand.setParameters(JDBCD efinedFinderCommand.java:259) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159 ) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.execute(JDBCFinderCommand. java:87) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEnti tiesCommand.java:153) [JAWS] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntities(JAWSPersisten ceManager.java:144) [JAWS] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManag er.java:305) [JAWS] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:567) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine r.java:843) [JAWS] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync hronizationInterceptor.java:231) [JAWS] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt erceptor.java:154) [JAWS] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor .java:108) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:307) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav a:103) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106) [JAWS] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai nerInvoker.java:437) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:23 7) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182) [JAWS] at $Proxy195.findByFirstNameAny(Unknown Source) [JAWS] at com.zeborg.labor.ejb.session.purchaseOrderManager.PurchaseOrderManagerSB.sea rchContractorProfile(PurchaseOrderManagerSB.java:1026) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS essionContainer.java:650) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12 8) [JAWS] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess ionInstanceInterceptor.java:243) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:247) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) [JAWS] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java: 341) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI nvoker.java:393) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) [JAWS] at sun.rmi.transport.Transport$1.run(Transport.java:152) [JAWS] at java.security.AccessController.doPrivileged(Native Method) [JAWS] at sun.rmi.transport.Transport.serviceCall(Transport.java:148) [JAWS] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465) [JAWS] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7 06) [JAWS] at java.lang.Thread.run(Thread.java:484) [JAWS] java.sql.SQLException: Cannot convert class java.lang.String to SQL type requested [JAWS] at org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:930) [JAWS] at org.gjt.mm.mysql.PreparedStatement.setObject(PreparedStatement.java:936) [JAWS] at org.jboss.pool.jdbc.PreparedStatementInPool.setObject(PreparedStatementInPoo l.java:282) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.setParameter(JDBCCommand.java:33 4) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCDefinedFinderCommand.setParameters(JDBCD efinedFinderCommand.java:259) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand.jdbcExecute(JDBCCommand.java:159 ) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCFinderCommand.execute(JDBCFinderCommand. java:87) [JAWS] at org.jboss.ejb.plugins.jaws.jdbc.JDBCFindEntitiesCommand.execute(JDBCFindEnti tiesCommand.java:153) [JAWS] at org.jboss.ejb.plugins.jaws.JAWSPersistenceManager.findEntities(JAWSPersisten ceManager.java:144) [JAWS] at org.jboss.ejb.plugins.CMPPersistenceManager.findEntities(CMPPersistenceManag er.java:305) [JAWS] at org.jboss.ejb.EntityContainer.find(EntityContainer.java:567) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContaine r.java:843) [JAWS] at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invokeHome(EntitySync hronizationInterceptor.java:231) [JAWS] at org.jboss.ejb.plugins.EntityInstanceInterceptor.invokeHome(EntityInstanceInt erceptor.java:154) [JAWS] at org.jboss.ejb.plugins.EntityLockInterceptor.invokeHome(EntityLockInterceptor .java:108) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:135) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:307) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeHome(TxInterceptorCMT.java:86) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invokeHome(SecurityInterceptor.jav a:103) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invokeHome(LogInterceptor.java:106) [JAWS] at org.jboss.ejb.EntityContainer.invokeHome(EntityContainer.java:420) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invokeHome(JRMPContai nerInvoker.java:437) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invokeHome(HomeProxy.java:23 7) [JAWS] at org.jboss.ejb.plugins.jrmp.interfaces.HomeProxy.invoke(HomeProxy.java:182) [JAWS] at $Proxy195.findByFirstNameAny(Unknown Source) [JAWS] at com.zeborg.labor.ejb.session.purchaseOrderManager.PurchaseOrderManagerSB.sea rchContractorProfile(PurchaseOrderManagerSB.java:1026) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at org.jboss.ejb.StatefulSessionContainer$ContainerInterceptor.invoke(StatefulS essionContainer.java:650) [JAWS] at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:12 8) [JAWS] at org.jboss.ejb.plugins.StatefulSessionInstanceInterceptor.invoke(StatefulSess ionInstanceInterceptor.java:243) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT. java:247) [JAWS] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99) [JAWS] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195) [JAWS] at org.jboss.ejb.StatefulSessionContainer.invoke(StatefulSessionContainer.java: 341) [JAWS] at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerI nvoker.java:393) [JAWS] at java.lang.reflect.Method.invoke(Native Method) [JAWS] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:241) [JAWS] at sun.rmi.transport.Transport$1.run(Transport.java:152) [JAWS] at java.security.AccessController.doPrivileged(Native Method) [JAWS] at sun.rmi.transport.Transport.serviceCall(Transport.java:148) [JAWS] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:465) [JAWS] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:7 06) [JAWS] at java.lang.Thread.run(Thread.java:484) Can any one let me know as to what i'm missing here. btw I'm using MySQL as the DB. TIA Imran |