|
@ -23,7 +23,7 @@ import javax.jws.WebService;
|
|
|
public class SQLWebService implements ISQLWebService {
|
|
|
public static JdbcTemplate jdbcTemplate = null;
|
|
|
|
|
|
public void initJDBC() {
|
|
|
public void initJDBC() throws Exception{
|
|
|
if (jdbcTemplate == null) {
|
|
|
//jdbc:oracle:thin:hos/hos@//172.19.103.71:1521/orcl
|
|
|
//jdbc:mysql://172.19.103.71:1521/orcl?user=hos&password=hos&useUnicode=true&characterEncoding=UTF-8
|
|
@ -104,10 +104,10 @@ public class SQLWebService implements ISQLWebService {
|
|
|
String endDate,
|
|
|
String mobile,
|
|
|
String reportType) {
|
|
|
initJDBC();
|
|
|
WSReturnModel wsReturnModel = new WSReturnModel();
|
|
|
wsReturnModel.setTransactionCode(TransactionCode);
|
|
|
try {
|
|
|
initJDBC();
|
|
|
StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
|
|
|
if (!StringUtils.isEmpty(endDate)) {
|
|
|
sb.append(" and HDSD00_05_026 < '" + endDate + "'");
|
|
@ -167,10 +167,10 @@ public class SQLWebService implements ISQLWebService {
|
|
|
String TransactionCode,
|
|
|
String reportId,
|
|
|
String reportType) {
|
|
|
initJDBC();
|
|
|
WSReturnModel wsReturnModel = new WSReturnModel();
|
|
|
wsReturnModel.setTransactionCode(TransactionCode);
|
|
|
try {
|
|
|
initJDBC();
|
|
|
StringBuffer sb = new StringBuffer("select * from HDSD01_01 where 1=1 ");
|
|
|
if (!StringUtils.isEmpty(reportId)) {
|
|
|
sb.append(" and HDSD00_05_026 < '" + reportId + "'");
|
|
@ -241,10 +241,10 @@ public class SQLWebService implements ISQLWebService {
|
|
|
|
|
|
public static void main(String[] args) throws Exception {
|
|
|
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
|
|
|
Client client = factory.createClient("http://localhost:8080/service/sql?wsdl");
|
|
|
|
|
|
Client client = factory.createClient("http://172.19.103.71:8080/service/sql?wsdl");
|
|
|
//Client client = factory.createClient("http://localhost:8080/service/sql?wsdl");
|
|
|
try {
|
|
|
Object[] result = client.invoke("ExcuteSQL", "1000", "select * from stde_adapter_metadata"); // 按照方法的参数来提供值
|
|
|
Object[] result = client.invoke("ExcuteSQL", "10000", "select count(1) as COUNT,max(to_number(HDSD03_01_031)) as MAX_KEYVALUE from HDSC01_02 where 1=1 order by to_number(HDSD03_01_031)"); // 按照方法的参数来提供值
|
|
|
if (result != null && result.length > 0) {
|
|
|
System.out.println(result[0]); // 通过getUsername来获取对象的username属性
|
|
|
}
|