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);
}
Be First to Comment