cmidaofactory.java
来自「一个免费wap站」· Java 代码 · 共 28 行
JAVA
28 行
package com.eline.wap.cmi.dao;
import com.eline.wap.cmi.exceptions.CMIDAOSysException;
import com.eline.wap.common.util.AppKeys;
import com.eline.wap.common.util.AppSettings;
public class CMIDAOFactory {
static public MobileDAO getMobileDAO() throws CMIDAOSysException {
MobileDAO mobileDao = null;
try {
String provider = AppSettings.getInstance().getProperty(AppKeys.DS_TYPE);
if (provider == null || provider.equals("") || provider.equalsIgnoreCase("SQLServer"))
mobileDao = new MSSqlMobileDAO();
else if (provider.equalsIgnoreCase("Oracle"))
throw new CMIDAOSysException("unsupported datasource type.");
} catch (CMIDAOSysException e) {
throw new CMIDAOSysException("MobileDAO.getDAO: CMIDAOSysException while getting DAO type : \n" + e.getMessage());
} catch (Exception e) {
throw new CMIDAOSysException("MobileDAO.getDAO: Exception while getting DAO type : \n" + e.getMessage());
}
return mobileDao;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?