springjdbctournament.java
来自「一些很有用的spring的书籍」· Java 代码 · 共 21 行
JAVA
21 行
package com.apress.springbook.chapter05;
public class SpringJDBCTournament {
private org.springframework.jdbc.core.JdbcTemplate jdbcTemplate;
public void setDataSource(javax.sql.DataSource dataSource) {
this.jdbcTemplate =
new org.springframework.jdbc.core.JdbcTemplate(dataSource);
}
public int countTournamentRegistrations(int tournamentId) {
return this.jdbcTemplate.queryForInt(
"SELECT COUNT(0) FROM t_registrations WHERE " +
"tournament_id = ?", new Object[] { new Integer(tournamentId) }
);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?