线程示例ITeyehuabian - 超凡娱乐

线程示例ITeyehuabian

2019-02-02 08:29:29 | 作者: 碧萱 | 标签: 发动,数据库 | 浏览: 4059

import java.net.MalformedURLException; import ws.clinet.axis2.WebSoapBindingImplServiceCallbackHandler; import ws.clinet.axis2.WebSoapBindingImplServiceStub; import java.sql.Connection; import java.sql.DriverManager; public class OnTimeCreditIntf extends Thread private boolean bSuperUser = false; private boolean working = false; private String planXMLFileFN = ""; private String path = ""; private String staffNo = ""; private String pswd = ""; private String staffId = ""; private String siteId = ""; private String areaId = ""; private TranContext myDBTrans = null; private String curCreatePZDate = ""; protected Connection conn; //private static Log log = LogFactory.getLog(Worker.class); //private static MyLoger log = new MyLoger(); private Logger logger = Logger.getLogger(OnTimeCreditIntf.class); public OnTimeCreditIntf() public Connection getConnection() { try { conn = DriverManager.getConnection(Const.CONFIG_XML_DB_URL); return conn; } catch (Exception ex) { ex.printStackTrace(); return null; * 树立衔接 * @param driver * @param url * @param user * @param password * @return public Connection getConnection(String driver, String url, String user, String password) { try { Class.forName(driver); conn = DriverManager.getConnection(url, user, password); return conn; } catch (Exception ex) { ex.printStackTrace(); return null; public List getBJOnTimeCreditIntfSumbit() throws SQLException ArrayList list = new ArrayList(); ResultSet rs = null; StringBuffer strSql = new StringBuffer(); strSql.append(" SELECT TRIM(ORDER_SERIAL_NBR) ORDER_SERIAL_NBR, "); strSql.append(" TRIM(OWE_BUSINESS_TYPE_ID) OWE_BUSINESS_TYPE_ID,TRIM(STAFF_ID) STAFF_ID, "); strSql.append(" TRIM(SERV_ID) SERV_ID,TO_CHAR(CREATED_DATE, yyyymmddhhmmss) CREATED_DATE,TO_CHAR(COMPLETED_DATE, yyyymmddhhmmss) COMPLETED_DATE, "); strSql.append(" TRIM(STATE) STATE,TO_CHAR(STATE_DATE, yyyymmddhhmmss) STATE_DATE,TRIM(PROCESS_COUNT) PROCESS_COUNT, "); strSql.append(" TRIM(PRE_SERV_STATE) PRE_SERV_STATE,TRIM(REMARK) REMARK,TRIM(CHARGE) CHARGE,TRIM(BALANCE) BALANCE, "); strSql.append(" TRIM(CREDIT) CREDIT,TRIM(OWE_TASK_ITEM_ID) OWE_TASK_ITEM_ID "); strSql.append(" FROM A_WORK_ORDER "); strSql.append(" WHERE STATE=P0C AND ROWNUM 500 ORDER BY ORDER_SERIAL_NBR "); rs = myDBTrans.executeQuery(strSql.toString()); while (rs.next()) HashMap planInfo = new HashMap(); planInfo.put("ORDER_SERIAL_NBR",rs.getString("ORDER_SERIAL_NBR")); planInfo.put("OWE_BUSINESS_TYPE_ID",rs.getString("OWE_BUSINESS_TYPE_ID")); planInfo.put("STAFF_ID",rs.getString("STAFF_ID")); planInfo.put("SERV_ID",rs.getString("SERV_ID")); planInfo.put("CREATED_DATE",rs.getString("CREATED_DATE")); planInfo.put("COMPLETED_DATE",rs.getString("COMPLETED_DATE")); planInfo.put("STATE",rs.getString("STATE")); planInfo.put("STATE_DATE",rs.getString("STATE_DATE")); planInfo.put("PROCESS_COUNT",rs.getString("PROCESS_COUNT")); planInfo.put("PRE_SERV_STATE",rs.getString("PRE_SERV_STATE")); planInfo.put("REMARK",rs.getString("REMARK")); planInfo.put("CHARGE",rs.getString("CHARGE")); planInfo.put("BALANCE",rs.getString("BALANCE")); planInfo.put("CREDIT",rs.getString("CREDIT")); planInfo.put("OWE_TASK_ITEM_ID",rs.getString("OWE_TASK_ITEM_ID")); list.add(planInfo); if (rs != null) { rs.close(); rs = null; return list; // public void updateBJOnTimeCreditIntfPlan(String requestId,String serial) throws SQLException // ResultSet rs = null; // StringBuffer strSql = new StringBuffer(); // strSql.append(" UPDATE A_WORK_ORDER SET STATE=P0P,REMARK=处理成功,SERIAL=" + serial + ""); // strSql.append(" WHERE ORDER_SERIAL_NBR= " + requestId); // rs = myDBTrans.executeQuery(strSql.toString()); public void deleteBJOnTimeCreditIntfPlan(String requestId) throws SQLException StringBuffer strSql = new StringBuffer(); strSql.append(" DELETE FROM A_WORK_ORDER "); strSql.append(" WHERE ORDER_SERIAL_NBR= " + requestId); myDBTrans.doBatch(strSql.toString()); public void insertBJOnTimeAWorkOrderLog(String requestId,String serial) throws SQLException StringBuffer strSql = new StringBuffer(); strSql.append(" INSERT INTO A_WORK_ORDER_LOG (order_serial_nbr,owe_business_type_id,staff_id, "); strSql.append(" serv_id,created_date,completed_date,state,state_date,process_count,pre_serv_state,remark,"); strSql.append(" tran_manual_date,hd_staff_id,charge,balance,credit,owe_task_item_id,SERIAL) "); strSql.append(" select order_serial_nbr,owe_business_type_id,staff_id, " ); strSql.append(" serv_id,created_date,completed_date,P0P,sysdate,process_count,pre_serv_state,remark,"); strSql.append(" null,null,charge,balance,credit,owe_task_item_id," +serial + " from A_WORK_ORDER "); strSql.append(" WHERE ORDER_SERIAL_NBR= " + requestId); myDBTrans.doBatch(strSql.toString()); public void updateBJOnTimeCreditFailPlan(String requestId,String error, String serial) throws SQLException StringBuffer strSql = new StringBuffer(); strSql.append(" UPDATE A_WORK_ORDER SET STATE=P0E,state_date=sysdate,REMARK=" + error + ",SERIAL=" + serial + ""); strSql.append(" WHERE ORDER_SERIAL_NBR= " + requestId); myDBTrans.doBatch(strSql.toString()); public OnTimeCreditIntf(String staffNo, String pswd, String path, String planXMLFileFN){ // if(this.conn null) { // this.conn = this.getConnection(); // this.conn.setAutoCommit(true); // } this.staffNo = staffNo; this.pswd = pswd; this.path = path; this.planXMLFileFN = path + File.separator + planXMLFileFN; // 发动数据库衔接 myDBTrans = new TranContext();
版权声明
本文来源于网络,版权归原作者所有,其内容与观点不代表超凡娱乐立场。转载文章仅为传播更有价值的信息,如采编人员采编有误或者版权原因,请与我们联系,我们核实后立即修改或删除。

猜您喜欢的文章