-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Query Works In Linux in once machine not in other machine
PostPosted: Thu Aug 26, 2004 1:24 am 
Newbie

Joined: Wed Jul 21, 2004 7:44 am
Posts: 7
Hibernate version: 2.1.3

Mapping documents:
<?xml version="1.0"?>

<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">

<hibernate-mapping>
<class
name="com.systec.lifetec.labs.valueobjects.LabBacterialSampleVO"
table="lab_bacterial_sample"
dynamic-update="false"
dynamic-insert="false"
>

<id
name="sampleID"
column="sample_id"
type="java.lang.String"
>
<generator class="assigned">
</generator>
</id>

<property
name="fdaNumber"
type="java.lang.String"
update="true"
insert="true"
column="fda_number"
/>

<property
name="unitNumber"
type="java.lang.String"
update="true"
insert="true"
column="unit_number"
/>

<property
name="productID"
type="int"
update="true"
insert="true"
column="product_id"
/>

<property
name="sampleEmpId"
type="java.lang.String"
update="true"
insert="true"
column="sample_emp_id"
/>

<property
name="sampleDateTime"
type="java.sql.Date"
update="true"
insert="true"
column="sample_datetime"
/>

<property
name="prelimResult"
type="java.lang.String"
update="true"
insert="true"
column="prelim_result"
/>

<property
name="prelimEmpID"
type="java.lang.String"
update="true"
insert="true"
column="prelim_emp_id"
/>

<property
name="prelimDateTime"
type="java.sql.Date"
update="true"
insert="true"
column="prelim_datetime"
/>

<property
name="prelimEnteredDateTime"
type="java.sql.Date"
update="true"
insert="true"
column="prelim_entered_datetime"
/>

<property
name="finalResult"
type="java.lang.String"
update="true"
insert="true"
column="final_result"
/>

<property
name="finalEmpID"
type="java.lang.String"
update="true"
insert="true"
column="final_emp_id"
/>

<property
name="finalDateTime"
type="java.sql.Date"
update="true"
insert="true"
column="final_datetime"
/>

<property
name="finalEnteredDateTime"
type="java.sql.Date"
update="true"
insert="true"
column="final_entered_datetime"
/>

<property
name="centerID"
type="char"
update="true"
insert="true"
column="center_id"
/>

<property
name="userID"
type="java.lang.String"
update="true"
insert="true"
column="updt_userid"
not-null="true"
/>

<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-LabBacterialSampleVO.xml
containing the additional properties and place it in your merge dir.
-->

</class>

</hibernate-mapping>



Code between sessionFactory.openSession() and session.close():

logger.info("In method findLabBacterialSampleVO"+" "+"Begin --");
query = "";
if(!Utils.nullChecker(sampleID,true)){ query = "from com.systec.lifetec.labs.valueobjects.LabBacterialSampleVO as labBacterialSampleVO where labBacterialSampleVO.sampleID ='"+sampleID.trim()+"'"; }
execute(null,"find");
logger.info("In method findLabBacterialSampleVO"+" "+"End --");
if(list!=null && !list.isEmpty()){
logger.info("In method findLabBacterialSampleVO"+" "+"list is not empty");
Iterator iterator = list.iterator();
LabBacterialSampleVO labBacterialSampleVO = (LabBacterialSampleVO)iterator.next();
return labBacterialSampleVO;
}



Full stack trace of any exception that occurs:

net.sf.hibernate.JDBCException: Could not execute query
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1515)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1491)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1483)
at com.systec.lifetec.common.hibernate.HibernateSF.find(HibernateSF.java:286)
at com.systec.lifetec.common.hibernate.HibernateSF.execute(HibernateSF.java:436)
at com.systec.lifetec.labs.hibernate.UploadResults.UploadResultSF.findLabBacterialSampleVO(UploadResultSF.java:1574)
at com.systec.lifetec.labs.hibernate.UploadResults.UploadResultSF.saveBacterialResults(UploadResultSF.java:715)
at com.systec.lifetec.labs.hibernate.UploadResults.UploadResultSF.processResults(UploadResultSF.java:947)
at com.systec.lifetec.labs.hibernate.UploadResults.UploadResultSF.checkTempTablesExists(UploadResultSF.java:897)
at com.systec.lifetec.labs.hibernate.UploadResults.UploadResultSF.readData(UploadResultSF.java:138)
at com.systec.lifetec.labs.userinterface.UploadResults.UploadResultsAction.uploadResult(UploadResultsAction.java:138)
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:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:280)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:216)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at com.systec.lifetec.common.userinterface.LifeTecRequestProcessor.processActionPerform(LifeTecRequestProcessor.java:52)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'from'.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processErrorToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRPCRequest.processReplyToken(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSRequest.processReply(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSCursorRequest.openCursor(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplStatement.execute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at com.microsoft.jdbc.base.BaseStatement.executeQueryInternal(Unknown Source)
at com.microsoft.jdbc.base.BasePreparedStatement.executeQuery(Unknown Source)
at weblogic.jdbc.wrapper.PreparedStatement.executeQuery(PreparedStatement.java:80)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:87)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:795)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:189)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:950)
at net.sf.hibernate.loader.Loader.list(Loader.java:941)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:834)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1512)
... 33 more


Name and version of the database you are using: SQL Server 2000

Debug level Hibernate log excerpt:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.