public static List<Map<String, Object>> SelectCampaign(String date) throws SQLException, ClassNotFoundException {
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/数据库名", "用户","密码");
PreparedStatement ptmt = connection.prepareStatement("SELECT CAMPAIGN_NO,FILE_RECORDS from aa ");
ResultSet rSet = ptmt.executeQuery();
List<Map<String, Object>> list = new ArrayList<>();
while (rSet.next()) {
Map<String, Object> map = new HashMap<>();
map.put("CAMPAIGN_NO", rSet.getString(1));
map.put("FILE_RECORDS", rSet.getInt(2));
list.add(map);
}
return list;
}