/* 请在适当的位置补充代码,完成指定的任务 提示: try { } catch 之间补充代码 */ import java.sql.*; public class Client { public static void main(String[] args) { Connection connection = null; Statement statement = null; ResultSet resultSet = null; try { } catch (ClassNotFoundException e) { System.out.println("Sorry,can`t find the JDBC Driver!"); e.printStackTrace(); } catch (SQLException throwables) { throwables.printStackTrace(); } finally { try { if (resultSet != null) { resultSet.close(); } if (statement != null) { statement.close(); } if (connection != null) { connection.close(); } } catch (SQLException throwables) { throwables.printStackTrace(); } } } }
理解问题/* 请在适当的位置补充代码,完成指定的任务 提示: try { } catch 之间补充代码 */ import java.sql.*; public class Client { public static void main(String[] args) { Connection connection = null; Statement statement = null; ResultSet resultSet = null; try { } catch (ClassNotFoundException e) { System.out.println("Sorry,can`t find the JDBC Driver!"); e.printStackTrace(); } catch (SQLException throwables) { throwables.printStackTrace(); } finally { try { if (resultSet != null) { resultSet.close(); } if (statement != null) { statement.close(); } if (connection != null) { connection.close(); } } catch (SQLException throwables) { throwables.printStackTrace(); } } } }
已完成理解「/* 请在适当的位置补充代码,完成指定的任务 提示: try { } catch 之间补充代码 */ import java.sql.*; public class Client { public static void main(String[] args) { Connection connection = null; Statement statement = null; ResultSet resultSet = null; try { } catch (ClassNotFoundException e) { System.out.println("Sorry,can`t find the JDBC Driver!"); e.printStackTrace(); } catch (SQLException throwables) { throwables.printStackTrace(); } finally { try { if (resultSet != null) { resultSet.close(); } if (statement != null) { statement.close(); } if (connection != null) { connection.close(); } } catch (SQLException throwables) { throwables.printStackTrace(); } } } }」
展开阅读网页