?? sqlcode.java~6~
字號:
package tool;
import java.util.Properties;
public class SQLCode {
private Properties sqlCodeProperties = new Properties();
SQLCode() {
load();
}
/*******************************************
* method name:getSQLCode
* method function :取得sqlcode.properties中的sql語句
* return type:String
* datetime : 2007-09-12
*******************************************/
public String getSQLCode(String sqlKey) {
String sql = "";
if (sqlCodeProperties.containsKey(sqlKey)) {
sql = sqlCodeProperties.getProperty(sqlKey);
}
return sql;
}
/*******************************************
* method name:load
* method function :指向sqlcode.properties的位置
* return type:void
* datetime : 2007-09-12
*******************************************/
public void load() {
String fileName = "/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 + -