`String query = "select count(book_id) as book_id from library_books_details where book_id = ?";`
PreparedStatement psEnd = collegeCon.prepareStatement(query);
psEnd.setInt(1, bookId);发布于 2014-03-11 12:43:39
ResultSet rs = psEnd.executeQuery();
if (rs.next()) {
int count= rs.getInt(1);
System.out.println("Count= " + count);
} else {
System.out.println("error: could not get the record counts");
} https://stackoverflow.com/questions/22316611
复制相似问题