CHWLearningNotes
Application配置
spring.datasource.url=jdbc:postgresql://***:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=123456
spring.datasource.driver-class-name=org.postgresql.Driver
#最大连接数
spring.datasource.tomcat.max-active=20
#最大空闲数
spring.datasource.tomcat.max-idle=8
#最小空闲数
spring.datasource.tomcat.min-idle=8
#初始化连接数
spring.datasource.tomcat.initial-size=10

注入jdbctemplate实现增删改查
@Autowired
JdbcTemplate jdbcTemplate;
List<Path> paths = jdbcTemplate.query(start, new Object[]{projectid, projectid}, new RowMapper<Path>() {
@Override
public Path mapRow(ResultSet rs, int rowNum) throws SQLException {
double slng = rs.getDouble("slng");
double slat = rs.getDouble("slat");
double elng = rs.getDouble("elng");
double elat = rs.getDouble("elat");
Node snode = new Node();
snode.setLng(slng);
snode.setLat(slat);
Node enode = new Node();
enode.setLng(elng);
enode.setLat(elat);
Path path = new Path();
path.setStart(snode);
path.setEnd(enode);
return path;
}
});

分类:

技术点:

相关文章:

  • 2021-04-17
  • 2021-10-23
  • 2022-01-08
  • 2021-10-09
  • 2022-01-08
  • 2021-12-02
  • 2019-01-10
  • 2021-11-22
猜你喜欢
  • 2021-08-03
  • 2021-11-22
  • 2021-11-22
  • 2021-12-04
  • 2021-07-09
  • 2021-11-22
  • 2021-11-22
相关资源
相似解决方案