?? dbconfig.java
字號:
package com.runwit.ebookstore.services.dao;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
public final class DbConfig {
private String url;
private String userName;
private String userPwd;
Properties prop;
private static DbConfig config;
private DbConfig() throws IOException{ //Class
InputStream is = DbConfig.class.getResourceAsStream("dbconnection.properties");
prop = new Properties();
prop.load(is);
url = prop.getProperty("url");
userName = prop.getProperty("user_name");
userPwd = prop.getProperty("user_pwd");
}
public String getUrl() {
return url;
}
public synchronized static DbConfig getInstance() throws IOException {
if(config == null)
config = new DbConfig();
return config;
}
public String getUserName() {
return userName;
}
public String getUserPwd() {
return userPwd;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -