首頁 > 資料庫 > mysql教程 > javaweb-使用DButils查询语句在DAO层报错Cannot Create Bean。。。query:。。。

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

WBOY
發布: 2016-06-06 09:32:52
原創
2447 人瀏覽過

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>
登入後複製

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>
登入後複製

privilegeBean

图片说明

相關標籤:
來源:php.cn
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板