?? sqlcode.java~1~
字號:
package com.tool;
public final class SQLCode {
private static SQLCode sqlCode = null;
private static java.util.Properties sqlCodeProperties = new java.util.
Properties();
static {
sqlCode = new SQLCode();
}
private SQLCode() {
_load();
}
//取得sqlcode.properties中的sql語句
public static String getSQLCode(String sqlKey) {
String sql = "";
if (sqlCodeProperties.containsKey(sqlKey)) {
sql = sqlCodeProperties.getProperty(sqlKey);
}
return sql;
}
public static SQLCode getInstance() {
return sqlCode;
}
//指向sqlcode.properties的位置
public void _load() {
String fileName = "/com/tool/sqlCode.properties";
//通過指定路徑找到資源文件存放在fileName中
sqlCodeProperties.clear();
//sqlCodeProperties清空
try {
java.io.InputStream in = null;
try {
in = getClass().getResourceAsStream(fileName);
//把fileName中存放值放入in字符流中
sqlCodeProperties.load(in);
}
finally {
in.close();
}
}
catch (java.io.IOException e) {
System.out.println(e.getMessage());
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -