jdbcTemplate.update的插入数据的语句这样写是错误的。
int update = jdbcTemplate.update(sql, new Object[]{openId, deptId, longitude, latitude,jwgeo},Integer.class);
这个不需要写他的返回值类型。
这样写是正确的
int update = jdbcTemplate.update(sql, new Object[]{openId, deptId, longitude, latitude,jwgeo});
架包
<!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-jdbc</artifactId>
<version>5.2.0.RELEASE</version>
</dependency>
<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.47<