Your current while
loop discards the first row (which is presumably the only row). Easiest solution I can see would be to change it to a do while
in the if
. Something like,
if(rs.next()) {
System.out.println("Purchase Order Shipped on " + str + " are: ");
do {
System.out.println(rs.getInt(1));
} while(rs.next());
} else {
System.out.println("empty rs");
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…