public int doCount(String No) throws SQLException {
Class.forName(driver);
connection conn = DriverManager.getConnection(url,username,password);
String sql = " SELECT COUNT(NO) FROM TABLE_NAME WHERE NO = ?;"
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, No);
ResultSet rs = ps.executeQuery();
while(rs.next()){
result = rs.getInt(1);
}
return result;
}
Class.forName(driver);
connection conn = DriverManager.getConnection(url,username,password);
String sql = " SELECT COUNT(NO) FROM TABLE_NAME WHERE NO = ?;"
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, No);
ResultSet rs = ps.executeQuery();
while(rs.next()){
result = rs.getInt(1);
}
return result;
}