Press "Enter" to skip to content

Maximum & minimum operation using java gui.

Source code of maximum & minimum operation in java gui

Maximum code..

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

Minimum code..

try{
String sql = "select min(age) from user";
pst = con.prepareStatement(sql);
rs = pst.executeQuery();
if(rs.next()){
String sum = rs.getString("min(age)");
jTextField_count.setText(sum);
}
}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 *