@@ -0,0 +1,822 @@
+package com.muchencute.commons.database;%0A%0Aimport javax.naming.Context;%0Aimport javax.naming.InitialContext;%0Aimport javax.naming.NamingException;%0Aimport javax.sql.DataSource;%0A%0Apublic class Database %7B%0A%0A    private static Database instance;%0A%0A    private DataSource dataSource;%0A%0A    private String mContextName;%0A%0A    private Database() %7B%0A%0A        try %7B%0A            Context initContext = new InitialContext();%0A            dataSource = (DataSource) initContext.lookup(mContextName);%0A        %7D catch (NamingException e) %7B%0A            e.printStackTrace();%0A            // System.exit(0);%0A        %7D%0A    %7D%0A%0A    public static DataSource getDataSource() %7B%0A%0A        return instance.dataSource;%0A    %7D%0A%0A    public void initContext(String contextName) %7B%0A%0A        this.mContextName = contextName;%0A%0A        instance = new Database();%0A    %7D%0A%7D%0A

update 增加数据库类