ddca7db43f3ef9970577d60452dcdf367d5fcfbc.svn-base
2.2 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
package yxy.timer.webservice.interfaces.impl;
import java.sql.Connection;
import java.sql.PreparedStatement;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import yxy.timer.tool.DBUtil;
import yxy.timer.webservice.interfaces.CustomerTypeWebservice;
@WebService(targetNamespace="http://CustomerTypeWebservice.interfaces.webservice.timer.yxy/",serviceName="typeWebservice")
public class CustomerTypeWebserviceImpl implements CustomerTypeWebservice
{
@WebResult(name="result")
@WebMethod
public String deleteCustomerType(@WebParam(name="type_id",targetNamespace="http://CustomerTypeWebservice.interfaces.webservice.timer.yxy/")int type_id)
{
String result = "";
if(type_id == 0)
{
result = "error";
return result;
}
try
{
Connection connection;
PreparedStatement pst;
//获取数据库的连接
connection = DBUtil.getConnection("dataSource");
String sql = "delete from yxy_customer_type where id="+type_id;
pst = connection.prepareStatement(sql);
pst.executeUpdate(sql);
result = "success";
return result;
}
catch(Exception e)
{
e.printStackTrace();
result = "error";
return result;
}
}
@WebResult(name="result")
@WebMethod
public String updateCustomerType(@WebParam(name="type_id",targetNamespace="http://CustomerTypeWebservice.interfaces.webservice.timer.yxy/")int type_id,
@WebParam(name="type_name",targetNamespace="http://CustomerTypeWebservice.interfaces.webservice.timer.yxy/")String type_name)
{
String result = "";
if(type_id == 0 || type_name==null)
{
result = "error";
return result;
}
try
{
Connection connection;
PreparedStatement pst;
//获取数据库的连接
connection = DBUtil.getConnection("dataSource");
String sql = "update yxy_customer_type set type_name='"+type_name+"' where id="+type_id;
pst = connection.prepareStatement(sql);
pst.executeUpdate(sql);
result = "success";
return result;
}
catch(Exception e)
{
e.printStackTrace();
result = "error";
return result;
}
}
}