Hi!
I have a fully working applications that runs on MySQL5. But now a new client demands MsSQL as database.
I run Hibernate 3.
MSSQL jdbc driver is jTds-1.2
the HQL query looks like this(working under MySQL)
Code:
Query query = session().createQuery("from User as user where user.name = :name");
query.setString("name",name);
Here is the stack trace..
Code:
2007-01-25 15:10:01,180 WARN [org.hibernate.util.JDBCExceptionReporter] Preparing the statement failed: Incorrect syntax near the keyword 'User'.
2007-01-25 15:10:01,180 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2007-01-25 15:10:01,196 DEBUG [javax.xml.rpc.soap.SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,strin
=java.lang.RuntimeException: org.hibernate.exception.GenericJDBCException: could not execute query using iterate,actor=null,detail=null]
2007-01-25 15:10:01,196 ERROR [org.jboss.ws.jaxrpc.SOAPFaultExceptionHelper] SOAP request exception
java.lang.RuntimeException: org.hibernate.exception.GenericJDBCException: could not execute query using iterate
at com.icr3.dao.UserDAO.getUserByName(UserDAO.java:112)
at com.icr3.dao.UserDAO.verifyUser(UserDAO.java:120)
at com.icr3.al.ICRUserManager.verifyUser(ICRUserManager.java:167)
at com.icr3.al.ICRWSManager.verifyUser(ICRWSManager.java:797)
at com.icr3.webservice.WSICR.verifyUser(WSICR.java:337)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.ws.server.ServiceEndpointInvokerJSE.invokeServiceEndpoint(ServiceEndpointInvokerJSE.java:91)
at org.jboss.ws.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:151)
at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:195)
at org.jboss.ws.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:373)
at org.jboss.ws.server.StandardEndpointServlet.doPost(StandardEndpointServlet.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.jboss.ws.server.StandardEndpointServlet.service(StandardEndpointServlet.java:77)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
I have also tried to querying using native SQL-syntax and then I a get an exception saying -
"SQL queries do not currently support iteration"
It sound like some cursor problem.. But I havenĀ“t found something.
Help is needed.