SQL code
<select id="getU" parameterClass="U" resultClass="U">
SELECT
A.usr_id as usrId
FROM
U A
WHERE
A.login_name=#loginName#
AND A.login_pwd=#loginPwd#
AND A.del_flg!=1
AND A.ban_time IS NULL
</select>
我直接执行这条Mysql语句是成功的
然后程序跑的时候报错:
Java code
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in sqlmap/U.xml.
--- The error occurred while applying a parameter map.
--- Check the getUserInfo-InlineParameterMap.
--- Check the statement (query failed).
--- Cause: java.sql.SQLException: Unknown type '16 in column 10 of 11 in binary-encoded result set.
Caused by: java.sql.SQLException: Unknown type '16 in column 10 of 11 in binary-encoded result set.
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:185)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
at com.miraclecastle.common.dao.CommonBaseDao.getList(CommonBaseDao.java:83)
at com.miraclecastle.common.dao.service.UserInfoService.login(UserInfoService.java:65)
at com.miraclecastle.servlet.UsrLoginServlet.service(UsrLoginServlet.java:105)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.sql.SQLException: Unknown type '16 in column 10 of 11 in binary-encoded result set.
at com.mysql.jdbc.MysqlIO.unpackNativeEncodedColumn(MysqlIO.java:4149)
at com.mysql.jdbc.MysqlIO.unpackBinaryResultSetRow(MysqlIO.java:3672)
at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1335)
at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2253)
at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:434)
at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1952)
at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1400)
at com.mysql.jdbc.Connection.serverExecute(Connection.java:4793)
at com.mysql.jdbc.ServerPreparedStatement.serverExecute(ServerPreparedStatement.java:1251)
at com.mysql.jdbc.ServerPreparedStatement.executeInternal(ServerPreparedStatement.java:993)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1448)
at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
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:597)
at com.ibatis.common.jdbc.logging.PreparedStatementLogProxy.invoke(PreparedStatementLogProxy.java:62)
at $Proxy1.execute(Unknown Source)
at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQuery(SqlExecutor.java:180)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.sqlExecuteQuery(GeneralStatement.java:205)
at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)
... 21 more
请大神帮帮忙,谢谢~!