-->
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.  [ 3 posts ] 
Author Message
 Post subject: java.sql.SQLException: Invalid column name Maedchen6_.
PostPosted: Thu Sep 02, 2004 7:52 am 
Newbie

Joined: Sun Feb 29, 2004 4:18 pm
Posts: 7
Hi,

I'm having a problem with a query using MS SQL2000/jTDS/hibernate, see stacktrace below. It seams when hibernate translastes a column name as follows: address0_.Maedchenname as Maedchen6_ .

I don't get this problem when the column id after the 'as' statement is generated without the underscore.

Funny thing is that when I try a copy-paste of the statement in the SQL2000 server console, everything works fine...

Could this have anything to do with hibernate? Or should I be looking at the driver?

Regards,
Wouter

Hibernate version: 2.1.6

Name and version of the database you are using: MS SQL2000 jTDS 0.9 rc 1

Debug level Hibernate log excerpt:

2004-09-02 13:17:30,133 DEBUG - [net.sf.hibernate.impl.BatcherImpl:226] select address0_.AdressID as AdressID, address0_.AdresseA as AdresseA, address0_.Ort as Ort, address0_.Vorname as Vorname, address0_.Nachname as Nachname, address0_.Maedchenname as Maedchen6_, address0_.Namenspraefix as Namenspr7_, address0_.KeineWerbung as KeineWer8_, address0_.AdresseB as AdresseB, address0_.PLZ as PLZ, address0_.Zusatz as Zusatz, address0_.AnredeID as AnredeID from Adressen address0_ where (address0_.AnredeID in(?))
2004-09-02 13:17:30,133 DEBUG - [net.sf.hibernate.impl.BatcherImpl:249] preparing statement
2004-09-02 13:17:30,133 DEBUG - [net.sf.hibernate.type.NullableType:46] binding '8' to parameter: 1
2004-09-02 13:17:31,164 DEBUG - [net.sf.hibernate.type.NullableType:68] returning '2897925' as column: AdressID
2004-09-02 13:17:31,164 DEBUG - [net.sf.hibernate.loader.Loader:480] result row: 2897925
2004-09-02 13:17:31,164 DEBUG - [net.sf.hibernate.loader.Loader:611] Initializing object from ResultSet: 2897925
2004-09-02 13:17:31,164 DEBUG - [net.sf.hibernate.loader.Loader:680] Hydrating entity: nl.<obfuscated by me>.Address#2897925
2004-09-02 13:17:31,164 DEBUG - [net.sf.hibernate.type.NullableType:68] returning 'Bachlaan' as column: AdresseA
2004-09-02 13:17:31,179 DEBUG - [net.sf.hibernate.type.NullableType:68] returning 'TILBURG' as column: Ort
2004-09-02 13:17:31,179 DEBUG - [net.sf.hibernate.type.NullableType:68] returning 'P.' as column: Vorname
2004-09-02 13:17:31,179 DEBUG - [net.sf.hibernate.type.NullableType:68] returning 'Zagge' as column: Nachname
2004-09-02 13:17:31,179 DEBUG - [net.sf.hibernate.util.JDBCExceptionReporter:36] SQL Exception
java.sql.SQLException: Invalid column name Maedchen6_.
at net.sourceforge.jtds.jdbc.JtdsResultSet.findColumn(JtdsResultSet.java:906)
at net.sourceforge.jtds.jdbc.JtdsResultSet.getString(JtdsResultSet.java:1149)
at org.apache.commons.dbcp.DelegatingResultSet.getString(DelegatingResultSet.java:216)
at net.sf.hibernate.type.StringType.get(StringType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.type.AbstractType.hydrate(AbstractType.java:66)
at net.sf.hibernate.loader.Loader.hydrate(Loader.java:686)
at net.sf.hibernate.loader.Loader.loadFromResultSet(Loader.java:627)
at net.sf.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:586)
at net.sf.hibernate.loader.Loader.getRow(Loader.java:501)
at net.sf.hibernate.loader.Loader.getRowFromResultSet(Loader.java:213)
at net.sf.hibernate.loader.Loader.loadSingleRow(Loader.java:150)
at net.sf.hibernate.hql.QueryTranslator.loadSingleRow(QueryTranslator.java:182)
at net.sf.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:414)
at net.sf.hibernate.impl.ScrollableResultsImpl.first(ScrollableResultsImpl.java:66)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2004 7:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Looks like a driver bug, the requested column is certainly there in the select clause.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 02, 2004 8:19 am 
Newbie

Joined: Sun Feb 29, 2004 4:18 pm
Posts: 7
I apologize, it seems I was one release candidate behind in which this bug was fixed.

Wouter


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.