java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
来源:互联网 发布:神知世界全文 编辑:程序博客网 时间:2024/06/03 11:16
这个错误是使用c3p0-0.9.2-pre1.jar配置数据库的时候,按照字面意思就是说:SQLException异常:QueryRunner需要一个数据源以这种方式调用,或者应该传入的连接池。我们看前半段,需要一个数据源说明问题在于是否有数据源,后半句是说明是否有连接池。所以我们需要打断点看 :
1.不能缺连接池并且连接池不能为NULL 这就让我们去查看我们是否配置正确然后正常的获得。
2.是否把连接池传入。
例如:
new QueryRunner();//忘记传入连接池
new QueryRunner(C3P0Utiles.getDataSource()); //修正之后
阅读全文
0 0
- java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
- java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
- 【c3p0】 java.sql.SQLException: An attempt by a client to checkout a Connection...
- java.sql.SQLException: An attempt by a client to checkout a Connection has timed out.
- java.sql.SQLException: An attempt by a client to checkout a Connection has timed out
- java.sql.SQLException: ORA-01799: a column may not be outer-joined to a subquery
- Hive 笔记异常java.sql.SQLException: Unable to open a test connection to the given database.
- dbcp连接池错误Failed to validate a poolable connection. java.sql.SQLException:
- java.sql.SQLException: ResultSet may only be accessed in a forward direction.报错
- oracle报错:java.sql.SQLException: An attempt by a client to checkout a Connection has timed out
- Caused by: java.sql.SQLException: An attempt by a client to checkout a Connection has timed out
- Vagrant is attempting to interface with the UI in a way that requires a TTY
- Hive 笔记异常(java.sql.SQLException: Unable to open a test connection to the given database. JDBC url =)
- java.sql.SQLException: ORA-28009: connection as SYS should be as SYSDBA or SYSOPER
- 解决 Android Nougat requires the IDE to be running with Java 1.8 or later Install a supported JDK
- jqgjava.sql.SQLException: An attempt by a client to checkout a Connection ha
- a simple way ,to programing or writting!
- java.sql.SQLException: Connection has already been created in this tx context for pool named ...
- javaWeb中页面设计小结
- 游戏架构设计的一些整理
- zepto 源码阅读记录
- 虚拟机:系统与进程的通用平台.pdf
- 从零到一学Mycat:入门及配置文件详解
- java.sql.SQLException: QueryRunner requires a DataSource to be invoked in this way, or a Connection
- Git 配置 ssh 公钥
- 系统烧写步骤
- JavaScript学习之二进制的 AST详解
- 部分和问题
- YOLO V2的改进点
- <统计学习方法>4 决策树(Decision Tree)
- 蒙特卡罗算法理解和简单实现
- Linux——shell学习笔记