2020
10-09
10-09
java项目中读取jdbc.properties文件操作
java内容Propertiesprops=Resources.getResourceAsProperties("jdbc.properties");Stringurl=props.getProperty("jdbc.url");Stringdriver=props.getProperty("jdbc.driverClass");Stringusername=props.getProperty("jdbc.username");Stringpassword=props.getProperty("jdbc.password");Class.forName(driver).newInstance();Connectionconn=(Connection)DriverManager.getConnection(url,username,passwor...
继续阅读 >