?? init.java
字號(hào):
package info;import java.io.*;import java.util.Properties;public class Init { private String superName=null; private String superPassword=null; private String driverName=null; private String DBURL=null; private String DBUser=null; private String DBPassword=null; private int pageView; public Init(String webPath) { Properties prop=new Properties(); if(!webPath.endsWith(System.getProperty("file.separator"))){ webPath+=System.getProperty("file.separator"); } try{ File file=new File(webPath+"WEB-INF"+System.getProperty("file.separator")+"guestbook.properties"); if(file.exists()){ FileInputStream fileIn=new FileInputStream(file); prop.load(fileIn); superName=prop.getProperty("superName"); superPassword=prop.getProperty("superPassword"); driverName=prop.getProperty("driverName"); DBURL=prop.getProperty("DBURL"); DBUser=prop.getProperty("DBUser"); DBPassword=prop.getProperty("DBPassword"); pageView=Integer.parseInt(prop.getProperty("pageView")); } else{ throw new FileNotFoundException("屬性文件未找到"); } } catch(IOException e){ throw new RuntimeException(e); } catch(NumberFormatException e){ throw new RuntimeException(e); } } public String getSuperName(){ return superName; } public String getSuperPassword(){ return superPassword; } public String getDriverName(){ return driverName; } public String getDBURL(){ return DBURL; } public String getDBUser(){ return DBUser; } public String getDBPassword(){ return DBPassword; } public int getPageView(){ return pageView; }}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -