日期:2014-05-17  浏览次数:20803 次

hibernate ORA-00932: 数据类型不一致: 应为 NUMBER, 但却获得 BINARY
用的是spring+hibernate+struts
在查询数据的时候报的如上的错误,
但是我把这条语句粘贴出来 放到plsqldev中是可以正常运行的。
往上查过可能的原因,说是应该为number的字段里面放入了null值
但是我有去检查,并没有这种情况。
语句是一个普通的不可能在普通的语句,就对单表进行查询。



------解决方案--------------------
把语句贴出来看看
------解决方案--------------------
没法知道...
------解决方案--------------------
我也碰到这个问题,就一个select语句报的错,费解
------解决方案--------------------
10:42:37,125 DEBUG HibernateTransactionManager:371 - Creating new transaction with name [com.jinzhi.prj.szxcode.service.UserService.getRoleAllNodes]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT,readOnly
10:42:37,125 DEBUG SessionImpl:220 - opened session at timestamp: 12760513571
10:42:37,125 DEBUG HibernateTransactionManager:496 - Opened new Session [org.hibernate.impl.SessionImpl@b92a3] for Hibernate transaction
10:42:37,125 DEBUG HibernateTransactionManager:507 - Preparing JDBC Connection of Hibernate Session [org.hibernate.impl.SessionImpl@b92a3]
10:42:37,125 DEBUG ConnectionManager:421 - opening JDBC connection
10:42:37,125 DEBUG DataSourceUtils:155 - Setting JDBC Connection [jdbc:oracle:thin:@192.168.1.100:1521:szxcode, UserName=SYSMAN, Oracle JDBC driver] read-only
10:42:37,125 DEBUG JDBCTransaction:54 - begin
10:42:37,125 DEBUG JDBCTransaction:59 - current autocommit status: true
10:42:37,125 DEBUG JDBCTransaction:62 - disabling autocommit
10:42:37,125 DEBUG HibernateTransactionManager:572 - Exposing Hibernate transaction as JDBC transaction [jdbc:oracle:thin:@192.168.1.100:1521:szxcode, UserName=SYSMAN, Oracle JDBC driver]
10:42:37,125 DEBUG PowerDAOImpl:86 - finding Power instance with property: roleId, value: null
10:42:37,125 DEBUG HibernateTemplate:410 - Found thread-bound Session for HibernateTemplate
10:42:37,125 DEBUG AbstractBatcher:366 - about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
10:42:37,125 DEBUG SQL:401 - select power0_.POWER_ID as POWER1_18_, power0_.ROLE_ID as ROLE2_18_, power0_.NODE_SYS_ID as NODE3_18_, power0_.NODE_ID as NODE4_18_ from SYSMAN.POWERINFO power0_ where power0_.ROLE_ID=?
10:42:37,171 DEBUG AbstractBatcher:374 - about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
10:42:37,171 DEBUG JDBCExceptionReporter:69 - could not execute query [select power0_.POWER_ID as POWER1_18_, power0_.ROLE_ID as ROLE2_18_, power0_.NODE_SYS_ID as NODE3_18_, power0_.NODE_ID as NODE4_18_ from SYSMAN.POWERINFO power0_ where power0_.ROLE_ID=?]
java.sql.SQLException: ORA-00932: 数据类型不一致: 应为 NUMBER, 但却获得 BINARY

at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:330)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:287)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:742)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:212)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:795)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1030)
at oracle.jdbc.driver.T4CPreparedStatement.executeMaybeDescribe(T4CPreparedStatement.java:835)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1123)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3284)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3328)
at org.apache.common