Home > Database > Mysql Tutorial > javaweb-使用DButils查询语句在DAO层报错Cannot Create Bean。。。query:。。。

javaweb-使用DButils查询语句在DAO层报错Cannot Create Bean。。。query:。。。

WBOY
Release: 2016-06-06 09:32:52
Original
2448 people have browsed it

javawebmysql

报错信息:

java.sql.SQLException: Cannot create Bean.privilege: Bean.privilege Query: select p.* from privilege p,privilege_role pr where p.id=pr.p_id and pr.r_id=? Parameters: [007]
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:392)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:351)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:180)
at dao.privilegeDao.getRoleprivileges(privilegeDao.java:80)
at service.BussinessService.getRolePrivileges(BussinessService.java:89)
at servlet.showRolePriUIServlet.doPost(showRolePriUIServlet.java:64)
at servlet.showRolePriUIServlet.doGet(showRolePriUIServlet.java:46)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:624)

<code>at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at filter.CharacterFilter.doFilter(CharacterFilter.java:28)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at filter.RoleFilter.doFilter(RoleFilter.java:50)at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505)at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:957)at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423)at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079)at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620)at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2516)at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2505)at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)at java.lang.Thread.run(Thread.java:619)</code>
Copy after login

DAO查询语句

<code>    public List<privilege> getRoleprivileges(String Rid){        try{            QueryRunner qr = new QueryRunner();            String sql = "select p.* from privilege p,privilege_role pr where p.id=pr.p_id and pr.r_id=? ";            return (List<privilege>) qr.query(JDBCUtils.getconnection(),sql,Rid,new BeanListHandler<privilege>(privilege.class));        }        catch(Exception e){            e.printStackTrace();            throw new RuntimeException();        }    } </privilege></privilege></privilege></code>
Copy after login

privilegeBean

图片说明

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template