FootStoneDao.java
1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package com.pipi.frt.dao;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.log4j.Logger;
import com.fangdd.qa.framework.utils.common.DbUtil;
import com.pipi.frt.sql.FootStoneSql;
public class FootStoneDao {
private static DbUtil DbUtil;
private final static Logger logger = Logger.getLogger(FootStoneDao.class);
public static int ps_person_contact_delete(String contact_name) {
DbUtil = new DbUtil();
String[] pereson_contact_list = {contact_name};
int res = DbUtil.delete(FootStoneSql.ps_person_contact_delete, pereson_contact_list);
DbUtil.close();
return res;
}
public static int ps_person_contact_phone_delete(String phone) {
DbUtil = new DbUtil();
String[] ps_pereson_contact_phone_list = {phone};
int res = DbUtil.delete(FootStoneSql.ps_person_contact_phone_delete, ps_pereson_contact_phone_list);
DbUtil.close();
return res;
}
public static String ps_person_contact_phone_query(String contact_id) {
String phone_id = null;
DbUtil = new DbUtil();
String[] ps_pereson_contact_phone_list = {contact_id};
ResultSet res = DbUtil.query(FootStoneSql.ps_person_contact_phone_query, ps_pereson_contact_phone_list);
try {
while (res.next()) {
phone_id = res.getString("phone_id");
System.out.println(phone_id);
}
} catch (SQLException e) {
e.printStackTrace();
}
DbUtil.close();
return phone_id;
}
public static void main(String args[]) {
// FootStoneDao.ps_person_contact_delete("董虎");
//FootStoneDao.ps_person_contact_phone_delete("13823774138");
FootStoneDao.ps_person_contact_phone_query("7f0000015e9806c6015f332a8a2f6fcc");
}
}