📄 bookrowmapper.java
字号:
package de.laliluna.library;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.jdbc.core.RowMapper;
/**
* rowmapper is used by Spring to read a line from a database table
* and to fill an instance of the class with the values
*/
public class BookRowMapper implements RowMapper {
public Object mapRow(ResultSet rs, int rowNum) throws SQLException {
// I use JDK 5 so I do not have to wrap int with an Integer object
Book book = new Book(rs.getInt("id"), rs.getString("title"),rs.getString("author"),rs.getInt("borrowedby"));
return book;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -