您要么需要在方法中 捕获 异常:
public void setupInfo(){ try { // call methods that might throw SQLException } catch (SQLException e) { // do something appropriate with the exception, *at least*: e.printStackTrace(); }}或 声明 抛出方法
SQLException:
private void setupInfo() throws SQLException{ // call methods that might throw SQLException}


