📄 f0429a2ea63d001d1504fdb15ccf7983
字号:
package com.daoImpl;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.List;
import com.dao.LiuyanDAO;
import com.jdbc.DataBaseConnection;
import com.vo.LiuyanVO;
public class LiuyanDAOImpl implements LiuyanDAO {
public List selectAll() {
ArrayList al = new ArrayList();
DataBaseConnection dbc =new DataBaseConnection();
PreparedStatement psmt =null;
ResultSet rs =null;
String sql =null;
LiuyanVO vo =null;
try{
sql="select * from liuyan";
psmt=dbc.getConnection().prepareStatement(sql);
rs=psmt.executeQuery();
while (rs.next()){
vo.setType(rs.getString(1));
vo.setName(rs.getString(2));
vo.setContent(rs.getString(3));
vo.setLiuyanTime(rs.getString(4));
al.add(vo);
}}
catch(Exception e){
}
}
return null;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -