时间:2021-07-01 10:21:17 帮助过:17人阅读
public static Connection getConnection() throws IOException, ClassNotFoundException, SQLException { Properties props = new Properties(); props.load(new FileInputStream("jdbc.properties")); Class.forName(props.getProperty("jdbc.driverClass")); String url = props.getProperty("jdbc.url"); String username = props.getProperty("jdbc.username"); String password = props.getProperty("jdbc.password"); return DriverManager.getConnection(url, username, password); }
DBCP
Spring
JPA
Hibernate
java 数据库连接
标签:ati jdbc .sql ber 基本 jdb sqlserver exce property