📄 dbpro.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 + -