最后
由于篇幅有限,这里就不一一罗列了,20道常见面试题(含答案)+21条MySQL性能调优经验小编已整理成Word文档或PDF文档
还有更多面试复习笔记分享如下
try {
properties.load(is);
} catch (IOException e) {
e.printStackTrace();
}
// 获取配置中的数据,从集合中获取
String driver = properties.getProperty(“driver”);
// 加载jdbc驱动
try {
Class.forName(driver);
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
// 获取连接对象
public Connection getConnection() {
// 获取配置中的数据,从集合中获取
String url = properties.getProperty(“url”);
String user = properties.getProperty(“user”);
String pwd = properties.getProperty(“pwd”);
// 获取连接对象
Connection connection = null;
try {
connection = DriverManager.getConnection(url, user, pwd);
} catch (SQLException throwables) {
throwables.printStackTrace();
}
// 返回连接对象
return connection;
}
// 关闭资源
public void closeAll(Connection connection, Statement statement, ResultSet resultSet) {
// 按顺序删除
if (resultSet != null) {
try {
resultSet.close();
} catch (SQLException throwables) {
th