private void button_saveandsubmitnowActionPerformed(java.awt.event.ActionEvent evt) {
con = JavaConnectDB.ConnectDB();
try{
String sql="select MISSINGPERSON_SEQUENCE.nextval from DUAL";
pst = (OraclePreparedStatement) con.prepareStatement(sql);
rs = (OracleResultSet) pst.executeQuery();
JOptionPane.showMessageDialog(null, "\nCase number: "+rs.getString(1));
rs = (OracleResultSet) pst.executeQuery();
if(rs.next()){
JOptionPane.showMessageDialog(null, "the details have been added successfully!!!");
con.close();
this.dispose();
}
else{
JOptionPane.showMessageDialog(null, "enter all fields appropriately first!!!");
}
con.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null, "An error occured. try again later !!!");
}
}