该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
本来是想通过jsp页面添加一个数据,跳转到访问serlvlet页面通过jbutils连接mqsql保存数据,但是我检查了c3p0的配置文件和datasource对象,queryrunner对象都可以正常新建,具体问题找不到,谢谢大家了这是访问页面的报错代码
HTTP Status 500 - java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
type Exception report
message java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.RuntimeException: java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
serviceimp.FoodTypeService.save(FoodTypeService.java:62)
servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65)
servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44)
servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105)
javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause
java.lang.RuntimeException: java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
daoimp.FoodTypeDao.save(FoodTypeDao.java:36)
serviceimp.FoodTypeService.save(FoodTypeService.java:59)
servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65)
servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44)
servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105)
javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
root cause
java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection should be passed in
org.apache.commons.dbutils.AbstractQueryRunner.prepareConnection(AbstractQueryRunner.java:200)
org.apache.commons.dbutils.QueryRunner.update(QueryRunner.java:437)
daoimp.FoodTypeDao.save(FoodTypeDao.java:34)
serviceimp.FoodTypeService.save(FoodTypeService.java:59)
servlet.FoodTypeServlet.addFoodType(FoodTypeServlet.java:65)
servlet.FoodTypeServlet.doGet(FoodTypeServlet.java:44)
servlet.FoodTypeServlet.doPost(FoodTypeServlet.java:105)
javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.39 logs.