扫码关注官方订阅号
认证高级PHP讲师
你使用的是什么数据库?你把参数(long id)换成(Integer id)。报这个错的原因的类型转换失败。long类型无法转换成Integer类型。
可以将id在方法里面转为Integer后在放入dc里面,
String str = id.toString();Integer id1 = Integer.valueOf(str);或者Integer id1 = new Integer(str);
实在想强转的话,先把long转成string,然后string转integer
long
string
integer
微信扫码关注PHP中文网服务号
QQ扫码加入技术交流群
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
PHP学习
技术支持
返回顶部
你使用的是什么数据库?
你把参数(long id)换成(Integer id)。
报这个错的原因的类型转换失败。
long类型无法转换成Integer类型。
可以将id在方法里面转为Integer后在放入dc里面,
String str = id.toString();
Integer id1 = Integer.valueOf(str);
或者Integer id1 = new Integer(str);
实在想强转的话,先把
long转成string,然后string转integer