public boolean excute() { String sql = builder.toString(); clear(); try { excutor.excute(sql); return true; } catch (SQLException e) { // TODO Auto-generated catch block System.out.println("SQL语句有问题"); System.out.println(sql); e.printStackTrace(); return false; } }
public ResultSet excuteQuery() { ResultSet resultSet = null; String sql = builder.toString(); clear(); try { resultSet = excutor.excuteQuery(sql); } catch (SQLException e) { // TODO: handle exception System.out.println("SQL语句有问题"); System.out.println(sql); e.printStackTrace(); } return resultSet; }
public SQLBuilder() { excutor = Excutor.getInstance(); builder = new StringBuilder(); }