MySQL转HTTP接口(27)-支持文档
```java
public List<Student> query() throws SQLException {
Connection conn = DbUtil.getConnection();
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT user_name, age FROM student");
List<Student> list = new ArrayList<Student>();
Student stu = null;
while(rs.next()){
list = new Student();
list.setUser_name(rs.getString("user_name"));
list.setAge(rs.getInt("age"));
list.add(list);
}
DbUtil.close(stmt,conn);
return list;
}
```