这是肥皂法
@WebMethod(operationName = "getCustomernamelist")
public ArrayList<ArrayList<String>> getCustomernamelist() {
try {
makeConnection();
System.out.println("Connected");
} catch(SQLException e) {
System.out.println("COnnection Failure");
}
ArrayList<String> names = new ArrayList<String>();
ArrayList<String> accNo = new ArrayList<String>();
ArrayList<ArrayList<String>> all = new ArrayList<ArrayList<String>>();
try{
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("SELECT name, acc_number FROM customer");
while(rs.next()){
names.add(rs.getString("name"));
accNo.add(rs.getString("acc_number"));
}
all.add(names);
all.add(accNo);
} catch(SQLException ex) {
System.out.println("SQL Exception");
}
return all;
}
我无法访问arraylist中的arraylist。检查图像的图像URL。 你的时间很多!