使用DBUtils报错connot create bean 错误解决的办法
public class c3p0_connection {public static void main(String[] args) throws Exception {ComboPooledDataSource source = new ComboPooledDataSource();//创建对象String sql="select * from root";QueryRunner runner = new QueryRunner(source);List<Root> list = runner.query(sql,new BeanListHandler<Root>(Root.class));for (Root root : list) {System.out.println(root.getPassword());System.out.println(root.getUsername()); }
}
Exception in thread "main" java.sql.SQLException: Cannot create JavaBean.Root: JavaBean.Root Query: select * from root Parameters: []
at org.apache.commons.dbutils.AbstractQueryRunner.rethrow(AbstractQueryRunner.java:527)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:391)
at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:347)
at JavaBean.c3p0_connection.main(c3p0_connection.java:14)
一直报错:connot create bean 。 原因是Root类中没有无参构造,补充一个无参函数即可解决问题
使用DBUtils报错connot create bean 错误解决的办法相关推荐
- 【踩坑日记】springboot项目启动报错error create bean with name
前言 启动springboot项目报错error create bean with name xxx 以为是哪个bean没有装配上,排查了所有的bean,发现都装配了 原因分析 仔细看了报错日志,发现 ...
- strict standards php报错,Bigcommerce:PHP版本升级错误解决办法_PHP教程
报错内容一:Strict Standards: Declaration of....should be compatible with ..... Strict Standards: Declarat ...
- oracle报错1455,oracle 1455 错误解决办法
oracle 1455 错误解决办法 oracle 1455 错误解决办法 ORA-01455: 转换列溢出整数数据类型 在用 expuser/pwd@oraclesidfile=e:\abc530. ...
- Navicat连接oracle 报错cannot create oci enviroment解决
①instantclient版本过低,之前我的是10.2,需要更高级的版本 ②Navicat 32位的需安装32位的oracle instantclient(我的电脑安装的32位Navicat破解版) ...
- 成功解决调用密钥报错4001 加密方式错误
成功解决调用密钥报错4001 加密方式错误 目录 解决问题 解决思路 解决方法 解决问题 成功解决调用密钥报错4001 加密方式错误 解决思路 秘钥没有打开,会出现这样的错误! 解决方法 关掉密钥按钮 ...
- Spring Cloud Stream报错:Invalid bean definition with name:bean definition with this name already exist
当想使用 Spring Cloud Stream 让微服务自己生产的消息自己消费时,如果使用的@Input("xxx")与@Output("xxx")注解中的& ...
- 启动springboot报错Error creating bean with name 'dataSource' defined in class path resource
2019独角兽企业重金招聘Python工程师标准>>> 启动springboot报错Error creating bean with name 'dataSource' define ...
- jmeter连接MySQL出错_MySQL数据库之jmeter连接mysql数据库报错Cannot create PoolableConnectionFactory...
本文主要向大家介绍了MySQL数据库之jmeter连接mysql数据库报错Cannot create PoolableConnectionFactory ,通过具体的内容向大家展现,希望对大家学习M ...
- OpenFOAM算例报错,浮点溢出错误,Floating point exception【汇总】
OpenFOAM算例报错,浮点溢出错误[汇总] 错误情况1: 在运行案例文件时出现以下错误: Floating point exception (core dumped) 浮点溢出.浮点数例外(吐核) ...
- SQL数据库挂起 SQL数据库附加报错 SQL数据库824错误修复
SQL数据库挂起 SQL数据库附加报错 SQL数据库824错误修复 数据类型 MSSQL 2012 数据大小 4.5 GB 故障检测 附加数据库提示824错误 一般是由于断电非法关机导致页面损坏. 客 ...
最新文章
- EasyUI –tree、combotree学习总结
- 关于缓存命中率的几个关键问题!
- 十五、深入Java的数组(上篇)
- 网络爬虫_第二章_提取_第四单元_BeautifulSoup库入门(未完待续)
- DIV+CSS—菜鸟分享学习心得!导航篇
- 【hortonworks/registries】SchemaVersionLifecycleManager.createSchemaVersion null
- Linux 常见命令操作(杀死全部screen)
- 天津农学院计算机科学与技术在那个校区,天津农学院有几个校区及校区地址
- 【OpenFOAM】用VS Code调试OpenFOAM
- APP一键登录测试点
- 【原创】VBA学习笔记(6)VBE编辑器,VBA工程,各种窗口
- Windows 2008 Server线程池前瞻(原创)
- 让你相见恨晚的PS技巧分享
- 做眼镜识别的人脸检测
- 软件需求工程 高校教学平台 需求变更控制会规程
- java按键程序_一个使用JAVA编写的类似按键精灵的程序,支持脚本文件编写(含源代码)...
- 4Rs营销理论(The Marketing Theory of 4Rs)
- [系统安全]目前修复系统漏洞最好的中文软件
- Docker与k8s的恩怨情仇 系列
- Windows Server 2016服务器部署Sql Server 2016