String findSql="select id from tb_user_openid where user_id=? and open_id=?";
jdbcTemplate.queryForMap(findSql, user.getId(), openid);
执行findSql报错信息:
SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]
解决方法:
数据库表字段的数据类型不匹配,字符串类型要加上单引号
String findSql="select id from tb_user_openid where user_id='?' and open_id='?'";
jdbcTemplate.queryForMap(findSql, user.getId(), openid);
本文地址:http://www.yayihouse.com/yayishuwu/chapter/1197