-->
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.  [ 7 posts ] 
Author Message
 Post subject: Problem with JTDS 0.6 jdbc driver
PostPosted: Wed Jan 21, 2004 2:35 pm 
Newbie

Joined: Wed Nov 12, 2003 11:07 am
Posts: 15
Location: Canada
Hi,
I switched from MS JDBC driver to JTDS to access SQL 2000 server. I am getting SQLException: Invalid object name 'Product' . I have Product class and all related mapping files. Actually it is working with MS JDBC driver. Any idea what might cause this.
Thanks,

Here is part of my hibernate debug info:


DEBUG: 2004-01-21 13:27:21,011: BatcherImpl: select product0_.id as id0_, product0_.description as descript2_0_, product0_.id_text as id_text0_, product0_.is_segregated as is_segre4_0_, product0_.has_foreign_content as has_fore5_0_, product0_.allow_third_party as allow_th6_0_, product0_.implementation_time as implemen7_0_ from Product product0_ where product0_.id=?
DEBUG: 2004-01-21 13:27:21,011: BatcherImpl: preparing statement
DEBUG: 2004-01-21 13:27:21,043: NullableType: binding '168' to parameter: 1
DEBUG: 2004-01-21 13:27:21,058: JDBCExceptionReporter: SQL Exception
java.sql.SQLException: Invalid object name 'Product'.
at net.sourceforge.jtds.jdbc.SqlMessage.toSQLException(SqlMessage.java:85)
at net.sourceforge.jtds.jdbc.SQLWarningChain.addOrReturn(SQLWarningChain.java:108)
at net.sourceforge.jtds.jdbc.TdsStatement.getMoreResults(TdsStatement.java:686)
at net.sourceforge.jtds.jdbc.TdsStatement.executeCallImpl(TdsStatement.java:231)
at net.sourceforge.jtds.jdbc.TdsStatement.internalExecuteCall(TdsStatement.java:214)
at net.sourceforge.jtds.jdbc.PreparedStatement_base.execute(PreparedStatement_base.java:169)
at net.sourceforge.jtds.jdbc.PreparedStatement_base.executeQuery(PreparedStatement_base.java:199)
at net.sf.hibernate.impl.BatcherImpl.getResultSet(BatcherImpl.java:83)
at net.sf.hibernate.loader.Loader.getResultSet(Loader.java:796)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:190)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:132)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:832)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:852)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:57)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:49)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:420)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2044)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1918)
at net.sf.hibernate.impl.SessionImpl.get(SessionImpl.java:1854)
at com.cgi.bestmix.db.hibernate.persistence.BaseDAO.retrieveObjb(BaseDAO.java:56)
at com.cgi.bestmix.db.dao.cfg.CfgDbDAO.retrieveObj(CfgDbDAO.java:71)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 2:54 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
Is the table actually named Product?

Also, have you by any chance tried using jTDS 0.5.1? I believe 0.6 had some pretty significant changes. I decided to stay with 0.5.1 for the time being, just in case.

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 3:38 pm 
Newbie

Joined: Wed Nov 12, 2003 11:07 am
Posts: 15
Location: Canada
jfifield wrote:
Is the table actually named Product?

Also, have you by any chance tried using jTDS 0.5.1? I believe 0.6 had some pretty significant changes. I decided to stay with 0.5.1 for the time being, just in case.

Joe


Table Product exists and it works if I switch back to MS jdbc driver. All I did used jdts. I also tested with 0.5.1, same results.

Thanks,
-Kourosh


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 3:40 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
What's your jtds jdbc url look like?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 3:44 pm 
Newbie

Joined: Wed Nov 12, 2003 11:07 am
Posts: 15
Location: Canada
jfifield wrote:
What's your jtds jdbc url look like?



hibernate.connection.username=sa
hibernate.connection.password=sa
hibernate.connection.tds="7.0"
hibernate.dialect=net.sf.hibernate.dialect.SybaseDialect
# A common mistake is to append a semicolon (";") to the end of the URL
hibernate.connection.url=jdbc\:jtds\:sqlserver\://fpsdev\:1433;SelectMethod\=cursor;DatabaseName\=testDB

hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
hibernate.jdbc.use_scrollable_resultset true


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 3:53 pm 
Regular
Regular

Joined: Tue Aug 26, 2003 3:09 pm
Posts: 58
From jtds.sourceforge.net:

jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]

Try putting the database name after the server name:

jdbc:jtds:sqlserver://fpsdev:1433/testDB

Joe


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 21, 2004 3:57 pm 
Newbie

Joined: Wed Nov 12, 2003 11:07 am
Posts: 15
Location: Canada
jfifield wrote:
From jtds.sourceforge.net:

jdbc:jtds:<server_type>://<server>[:<port>][/<database>][;<property>=<value>[;...]]

Try putting the database name after the server name:

jdbc:jtds:sqlserver://fpsdev:1433/testDB

Joe


Thank you so much Joe!!! It worked.
Regards,
-Kourosh


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

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.