Press "Enter" to skip to content

Table row count using java gui.

Source code of count operation in java gui.

try{
String sql = "select count(id) from user";
pst = con.prepareStatement(sql);
rs = pst.executeQuery();
if(rs.next()){
String cnt = rs.getString("count(id)");
jTextField_count.setText(cnt);
}
}catch(SQLException e){
JOptionPane.showMessageDialog(null, e);
}

Interface of after run the page.

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *