Properties myProperty = new Properties();
String jdbcPath = PathKit.getWebRootPath()+File.separator+"WEB-INF"+File.separator+"classes"+File.separator+"jdbc.properties" InputStream inputStream = new FileInputStream(new File(jdbcPath)); myProperty.load(inputStream); String driverClass = myProperty.getProperty("driverClass"); String url = myProperty.getProperty("jdbcUrl"); String user = myProperty.getProperty("user"); String password = myProperty.getProperty("password");
PathKit.getWebRootPath()为JFinal获取路径的方法。