java.lang.Long cannot be cast to java.lang.Integer
PHP中文网
PHP中文网 2017-04-18 10:12:57
0
3
459
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
大家讲道理

What database are you using?
You replace the parameter (long id) with (Integer id).
The reason why this error is reported is that the type conversion failed.
The long type cannot be converted to the Integer type.

伊谢尔伦

You can convert the id to Integer in the method and then put it into the dc,

String str = id.toString();
Integer id1 = Integer.valueOf(str);
or Integer id1 = new Integer(str);

PHPzhong

If you really want to force transfer, first long转成string,然后stringinteger

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!