userdaofactory.java~

来自「J2EE & Tomcat books published by hope」· JAVA~ 代码 · 共 39 行

JAVA~
39
字号
/* * $Id: UserDAOFactory.java~,v 1.1 2002/01/04 21:04:50 jc123804 Exp $ * Copyright 2001 Sun Microsystems, Inc. All rights reserved. * Copyright 2001 Sun Microsystems, Inc. Tous droits r閟erv閟. */package com.sun.j2ee.workflow.user.dao;import javax.naming.NamingException;import javax.naming.InitialContext;import com.sun.j2ee.blueprints.customer.util.JNDINames;import com.sun.j2ee.blueprints.customer.account.exceptions.AccountDAOSysException;import com.sun.j2ee.blueprints.util.tracer.Debug;public class UserDAOFactory {    /**     * This method instantiates a particular subclass implementing     * the DAO methods based on the information obtained from the     * deployment descriptor     */    public static AccountDAO getDAO() throws AccountDAOSysException {        AccountDAO acctDao = null;        try {            InitialContext ic = new InitialContext();            String className = (String) ic.lookup(JNDINames.ACCOUNT_DAO_CLASS);            acctDao = (AccountDAO) Class.forName(className).newInstance();        } catch (NamingException ne) {            throw new AccountDAOSysException("AccountDAOFactory.getDAO:  NamingException while getting DAO type : \n" + ne.getMessage());        } catch (Exception se) {            throw new AccountDAOSysException("AccountDAOFactory.getDAO:  Exception while getting DAO type : \n" + se.getMessage());        }        return acctDao;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?