dbconfig.java

来自「用来为垂直搜索引擎抓取数据的采集系统」· Java 代码 · 共 46 行

JAVA
46
字号
/*
 * *****************************************************
 * Copyright (c) 2005 IIM Lab. All  Rights Reserved.
 * Created by xuehao at Dec 5, 2005
 * Contact: zxuehao@mail.ustc.edu.cn
 * *****************************************************
 */
package org.indigo.util;

/**
 * 获取dbconfig中的属性类。
 * @author wbz
 *
 */
public class DBConfig
{
    private TaskProperties itsProps=null;
    private final static DBConfig itsDBConfig=new DBConfig();
   /**
    * 构造函数,实例化TaskProperties,并打开./conf/dbconfig文件。
    *
    */
    private DBConfig()
    {
        itsProps = new TaskProperties();
        itsProps.open( "./conf/dbconfig" );
    }
    /**
     *通过指定的关键字获取属性值。
     * @param key
     * @return
     */
    public String getProperty( String key )
    {
        return itsProps.getProperty( key );
    }
    /**
     * 单例模式,返回一个DBConfig的实例。
     * @return
     */
    public static DBConfig getInstance()
    {
        return itsDBConfig;
    }
}

⌨️ 快捷键说明

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