?? deleteorderutil.java
字號:
/**
*
*/
package com.air.backend.util;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import com.air.exceptions.AirException;
import com.air.persistence.DataSrcUtil;
import com.air.persistence.IsqlDataSource;
/**
* @author jelly_yang
*
*/
public class DeleteOrderUtil {
private static Log log = LogFactory.getLog(DeleteOrderUtil.class);
private DeleteOrderUtil() {
// TODO Auto-generated constructor stub
}
public static class DeleteOrderUtilHolder{
static DeleteOrderUtil deleteOrderUtil = new DeleteOrderUtil();
}
public static DeleteOrderUtil getInstance(){
return DeleteOrderUtilHolder.deleteOrderUtil;
}
public boolean deleteOrder(String orderId)throws AirException{
int result = 0 ;
String sSql = "delete from destine where dId="+orderId;
IsqlDataSource src = DataSrcUtil.getInstance().getDataSource();
Connection conn = null;
log.debug("deleteOrder() -- sSql["+ sSql+ "]");
try
{
conn = src.getConnection();
Statement stmt = conn.createStatement();
result = src.executeUpdate(stmt, sSql);
}
catch(SQLException se)
{
log.error("deleteOrder() caught SQLException: " + se);
}
catch(Exception ex)
{
log.error("deleteOrder() caught Exception: " + ex);
}
finally
{
src.closeConn(conn);
}
if(result==0){
return false;
}
return true;
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -