java.sql.SQLException: Cannot set billDate: incompatible types.

An error suddenly appeared when I was running the code.

The error information is as follows.

复制代码
Exception in thread "main" java.lang.RuntimeException: java.sql.SQLException: Cannot set billDate: incompatible types. Query: SELECT bill.*, NAME FROM bill, menu WHERE bill.menuId = menu.id Parameters: []
	at com.mhl.dao.BasicDAO.queryMulti(BasicDAO.java:56)
	at com.mhl.service.BillService.list2(BillService.java:53)
	at com.mhl.view.MHLView.listBill(MHLView.java:86)
	at com.mhl.view.MHLView.mainMenu(MHLView.java:247)
	at com.mhl.view.MHLView.main(MHLView.java:33)
Caused by: java.sql.SQLException: Cannot set billDate: incompatible types. Query: SELECT bill.*, NAME FROM bill, menu WHERE bill.menuId = menu.id Parameters: []
	at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:542)
	at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:399)
	at com.mhl.dao.BasicDAO.queryMulti(BasicDAO.java:53)
	... 4 more

I went looking for a solution to the error, and in the process I discovered that the date-time type used when the table was created was datatime, whereas the type defined in the code was data.

Then I drop the table named bill, and create it again.

I then re-added the data and displayed the bill, this time successfully getting the result.

相关推荐
wuk99818 分钟前
matlab为地图进行四色着色
开发语言·matlab
_MyFavorite_18 分钟前
cl报错+安装 Microsoft Visual C++ Build Tools
开发语言·c++·microsoft
charlie11451419119 分钟前
现代嵌入式C++教程:C++98——从C向C++的演化(2)
c语言·开发语言·c++·学习·嵌入式·教程·现代c++
zmzb010323 分钟前
C++课后习题训练记录Day55
开发语言·c++
李白同学26 分钟前
C++:继承
开发语言·c++
k***921626 分钟前
【C++】STL详解(九)—priority_queue的使用与模拟实现
开发语言·c++
速易达网络39 分钟前
基于Java TCP 聊天室
java·开发语言·tcp/ip
沿着路走到底1 小时前
JS事件循环
java·前端·javascript
Hard but lovely1 小时前
C++11: 自定义异常&&标准异常体系&&回顾c异常处理方式
开发语言·c++
爱笑的眼睛111 小时前
超越 `cross_val_score`:深度解析Scikit-learn交叉验证API的架构、技巧与陷阱
java·人工智能·python·ai