bf2c725f5e83d803e921b42a985fe75908d83484.svn-base
1.5 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
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.UserSignatureWebservice;
@WebService(targetNamespace="http://UserSignatureWebservice.interfaces.webservice.timer.yxy/",serviceName="signatureWebservice")
public class UserSignatureWebserviceImpl implements UserSignatureWebservice
{
@WebResult(name="result")
@WebMethod
public String updateUserSignature(@WebParam(name="id",targetNamespace="http://UserSignatureWebservice.interfaces.webservice.timer.yxy/")int id,
@WebParam(name="title",targetNamespace="http://UserSignatureWebservice.interfaces.webservice.timer.yxy/")String title,
@WebParam(name="body",targetNamespace="http://UserSignatureWebservice.interfaces.webservice.timer.yxy/")String body)
{
String result = "";
if(id == 0 && title == null && body == null)
{
result = "error";
return result;
}
try
{
Connection connection;
PreparedStatement pst;
//获取数据库的连接
connection = DBUtil.getConnection("dataSource");
String sql = "update yxy_user_signature set title='"+title+"',body='"+body+"' where id="+id;
pst = connection.prepareStatement(sql);
pst.executeUpdate(sql);
result = "success";
return result;
}
catch(Exception e)
{
e.printStackTrace();
result = "error";
return result;
}
}
}