Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void RandomAcc(){
- Random ra=new Random();
- jTextField1.setText(""+ra.nextInt(10000+1));
- }
- public void RandomMICR(){
- Random ra=new Random();
- jTextField2.setText(""+ra.nextInt(1000+1));
- }
- public void RandomPIN(){
- Random ra=new Random();
- jTextField3.setText(""+ra.nextInt(1000+1));
- }
- public void Bal(){
- String sql="insert into Balances(Name,Acc,MICR_No,Balance) values(?,?,?,?)";
- try{
- pst=conn.prepareStatement(sql);
- pst.setString(1, jTextField5.getText());
- pst.setString(2, jTextField1.getText());
- pst.setString(3, jTextField2.getText());
- pst.setString(4, jTextField10.getText());
- pst.execute();
- }catch(Exception e){`enter code here`
- JOptionPane.showMessageDialog(null, e);
- }
- String sql="insert into Account(Acc,Name,DOB,Pin,Acc_Type,Nationality,Caste,MICR_No,Gender,Mob,Address,Sec.Q,Sec.A,Balance) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
- try{
- pst=conn.prepareStatement(sql);
- pst.setString(1, jTextField1.getText());
- pst.setString(2, jTextField5.getText());
- pst.setString(3,((JTextField)jDateChooser1.getDateEditor().getUiComponent()).getText());
- pst.setString(4, jTextField3.getText());
- pst.setString(5, (String) jComboBox1.getSelectedItem());
- pst.setString(6, (String) jComboBox2.getSelectedItem());
- pst.setString(7, jTextField6.getText());
- pst.setString(8, jTextField2.getText());
- jRadioButton1.setActionCommand("Male");
- jRadioButton2.setActionCommand("Female");
- pst.setString(9, buttonGroup1.getSelection().getActionCommand());
- pst.setString(10, jTextField7.getText());
- pst.setString(11, jTextField4.getText());
- pst.setString(12, (String) jComboBox3.getSelectedItem());
- pst.setString(13, jTextField9.getText());
- pst.setString(14, jTextField10.getText());
- pst.execute();
- JOptionPane.showMessageDialog(null, "Congrtzn Account has been Created");
- Bal();
- }catch(Exception e){
- JOptionPane.showMessageDialog(null, e);
- }
- }
Add Comment
Please, Sign In to add comment