package com.yc.ycportal.gywork;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.util.List;
import javax.sql.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.loushang.waf.ComponentFactory;
public class ExePro {
private static Log log = LogFactory.getLog(ExePro.class);
public String exepro(String proname) {
DataSource logdao = (DataSource) ComponentFactory.getBean("dataSource");
Connection con = null;
CallableStatement csmt = null;
try {
con = logdao.getConnection();
log.info("-----------kaishi");
con.setAutoCommit(true);
csmt = con.prepareCall(proname);
csmt.executeUpdate();
con.setAutoCommit(false);
con.commit();
log.info("-----------jieshu");
} catch (Exception e) {
log.error("resetRecord Error:" + e.getMessage());
return "error"+e.getMessage();
} finally {
if (csmt != null) {
try {
csmt.close();
} catch (Exception e) {
log.error("关闭PreparedStatement出错:" + e.getMessage());
}
}
if (con != null) {
try {
con.close();
} catch (Exception e) {
log.error("关闭Connection出错:" + e.getMessage());
}
}
}
return "success";
}
}