📄 indexdao.java
字号:
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getPrint() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%打印机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getDC() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%相机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getDV() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%摄象机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getErJi() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%耳机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getYiDong() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%移动盘%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getTouYing() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%投影机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getFuWu() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%服务器%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getFuYin() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%复印机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getLuYou() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%路由器%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getJiaoHuan() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%交换机%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getXiangShui() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%香水%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getHuaZhuang() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%化妆品%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
public List<Index> getBaoJian() {
Connection conn = DBConnection.getConn();
Statement stmt = null;
ResultSet rs = null;
List<Index> ilist = new ArrayList<Index>();
String sql1 = "SELECT p.title,o.amount inamount,o.post_time,TO_DAYS(o.end_time)-TO_DAYS(NOW()) time,u.credit FROM webpk.offers o,webpk.products p,webpk.users u WHERE o.trade=0 and p.title like '%保健%' and p.productsid=o.productsid and o.email=u.email";
try {
stmt = conn.createStatement();
rs = stmt.executeQuery(sql1);
Index oin = null;
while (rs.next()) {
oin = new Index();
oin.setTitle(rs.getString("title"));
oin.setInamount(rs.getInt("Inamount"));
oin.setTime(rs.getInt("time"));
oin.setPost_time(rs.getDate("post_time"));
oin.setCredit(rs.getInt("credit"));
ilist.add(oin);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
DBConnection.closeConn();
}
return ilist;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -