Hibernate Error Code =-4460
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta invalid parameter unknown column name 1 errorcode 4460 Discuss the workings and policies of this site About Us Learn usejdbc4columnnameandlabelsemantics=2 more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us [ibm][db2][jcc][10150][10300] invalid parameter: unknown column name Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, usejdbc4columnnameandlabelsemantics example helping each other. Join them; it only takes a minute: Sign up db2jcc4.jar Invalid parameter: Unknown column name up vote 3 down vote favorite I previously asked the following question: DB2 query Unknown column name ERRORCODE=-4460, SQLSTATE=null We have since learned that changing from db2jcc4.jar (JCC) from db2jcc.jar (UNIVERSAL) solves the issue in our development environment. The
Set Usejdbc4columnnameandlabelsemantics
problem is that the one tha tdoesn't work is the newer one. We don't want to step backwards on our driver without really good cause. But the reason why the query in the above link is invalid in the new driver is not understood by me. We know it is that column...if we take it out of the results by forcing an empty space, everything works (except we don't get the data). The query works fine in other environments. I have seen some posts implying that this error is related to the result set meta data getColumn() method being inconsistent between JDBC3 and JDBC4. But we're not doing anything special in this query that isn't being done in many other queries, at least not as far as we can tell. Does anyone know what about this query might be setting things off? Is there a fix for this behavior...either some setting or workaround, or a new driver? The full exception: com.ibm.db2.jcc.a.SqlException: [jcc][10150][10300][4.3.111] Invalid parameter: Unknown >column name FILTER_VALUE_DECODE.
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just http://stackoverflow.com/questions/15981711/db2jcc4-jar-invalid-parameter-unknown-column-name like you, helping each other. Join them; it only takes a minute: Sign up Setting Hibernate 3 to use useJDBC4ColumnNameAndLabelSemantics up vote 0 down vote favorite We are using Hibernate 3 and DB2 running into the: Invalid parameter: Unknown column name FOO. ERRORCODE=-4460, SQLSTATE=null problem which is a common problem I see when searching online. Basically, http://stackoverflow.com/questions/33377518/setting-hibernate-3-to-use-usejdbc4columnnameandlabelsemantics we need to force Hibernate to retrieve columns by column name. An example of a Stack Overflow question is here If you read Mark Rotteveel's answer he suggests "set the useJDBC4ColumnNameAndLabelSemantics Connection or DataSource property to DB2BaseDataSource.NO (2)" My question is, how do I this in Hibernate? I cannot find an example of how to set a JDBC property such as this. Does Hibernate have this property built in? java hibernate db2 share|improve this question edited Oct 28 '15 at 12:18 mustaccio 10.7k41933 asked Oct 27 '15 at 20:07 badgerduke 4131723 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote The manual clearly explains how to set JDBC connection properties. If you use hibernate.properties to configure Hibernate, you add hibernate.connection.useJDBC4ColumnNameAndLabelSemantics=2 to the file. If you use hibernate.cfg.xml, you add
Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.