📄 typedao.java
字号:
package da0;
import java.util.*;
import java.sql.*;
import dto.*;
public class Typedao {
PreparedStatement ps = null;
ResultSet rs = null;
Connection con = null;
public Typedao() {
}
public ArrayList search() {
ArrayList arr = new ArrayList();
DBcon dbcon = new DBcon();
try {
con = dbcon.GetConnection();
String sql = "select tid,tname from types";
ps = con.prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()){
Typedto typedto = new Typedto();
typedto.setTid(rs.getInt("tid"));
typedto.setTname(rs.getString("tname"));
arr.add(typedto);
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
dbcon.CloseRs(rs);
dbcon.ClosePs(ps);
dbcon.CloseCon(con);
return arr;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -