⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dbpro.java

📁 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar 天乙代码src_531.rar
💻 JAVA
字号:
package com.laoer.bbscs.db;

import java.io.*;
import java.util.*;

/**
 * <p>Title: BBS-CS V5.0</p>
 * <p>Description: BBS-CS��������V5.0</p>
 * <p>Copyright: Copyright (c) 2003</p>
 * <p>Company: laoer.com</p>
 * @author ������
 * @version 5.0
 */

public class DBPro {

  static private DBPro instance;
  private String dbType = "";
  private String dbName = "";
  private String dbDrivers = "";
  private String dbUrl = "";
  private String dbLogFile = "";
  private String dbUser = "";
  private String dbPasswd = "";

  private DBPro() {
    initDBPro();
  }

  public static synchronized DBPro getInstance() {
    if (instance == null) {
      instance = new DBPro();
    }
    return instance;
  }

  public void initDBPro() {
    Properties prop_path = new Properties();
    try {
      InputStream is = getClass().getResourceAsStream("db.properties");
      prop_path.load(is);
      this.dbType = prop_path.getProperty("dbtype");
      this.dbName = prop_path.getProperty("dbname");
      this.dbDrivers = prop_path.getProperty("drivers");
      this.dbUrl = prop_path.getProperty(this.dbName + ".url");
      this.dbLogFile = prop_path.getProperty("logfile");
      this.dbUser = prop_path.getProperty(this.dbName + ".user");
      this.dbPasswd = prop_path.getProperty(this.dbName + ".password");
    }
    catch (IOException e) {
      System.out.println("[DBPro] Open db.properties File, Error!");
    }
  }

  public String getDBType() {
    return this.dbType;
  }

  public String getDBName() {
    return this.dbName;
  }

  public String getDBDrivers() {
    return this.dbDrivers;
  }

  public String getDBUrl() {
    return this.dbUrl;
  }

  public String getDBLogFile() {
    return this.dbLogFile;
  }

  public String getDBUser() {
    return this.dbUser;
  }

  public String getDBPasswd() {
    return this.dbPasswd;
  }

}

⌨️ 快捷键说明

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