PLEASE WHAT'S WRONG WITH THIS CODES, I KEEP GETTING ERROR AT THIS STAGE

String result = ci.insertDetails(cid, name, dateOfBirth,
            String.valueOf(cms.getSelectedItem()), address, city, state , zcode, cnum, nod);
            String day = String.valueOf(d.getSelectedItem());
            String month = String.valueOf(m.getSelectedItem());
            String year = String.valueOf(y.getSelectedItem());
            String ms = String.valueOf(cms.getSelectedItem());
            String dob = year + "-" + (m.getSelectedIndex() + 1) + "-" + day;

HERE'S THE FULL CODE.

import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

public class CustomerInformation extends JDialog implements ActionListener{

    JLabel heading = new JLabel("CUSTOMER INFORMATION");
    JLabel cid = new JLabel("Customer id");
    JTextField  tcid = new JTextField(10);
    JLabel name = new JLabel("First Name (Mr/Mrs/Miss):");
    JTextField tname = new JTextField(10);
    JLabel lname = new JLabel("Last Name:");
    JLabel dob = new JLabel("Date Of Birth");
    JComboBox d = new JComboBox();
    JComboBox m = new JComboBox();
    JComboBox y = new JComboBox();
    JLabel ms = new JLabel("Marital Status");
    JLabel day = new JLabel("Day");
    JLabel mon = new JLabel("Month");
    JLabel year = new JLabel("Year");
    JComboBox cms = new JComboBox();
    String[] ccms={"","Single", "Married"};
    String[] mont ={"","Jan",  "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept","Oct", "Nov", "Dec"};
    JLabel address = new JLabel("Address");
    JTextField tlname = new JTextField(10);
    JTextField taddress = new JTextField(20);
    JLabel city = new JLabel("City");
    JTextField  tcity = new JTextField(15);
    JLabel state = new JLabel("State");
    JTextField tstate = new JTextField(10);
    JLabel zcode = new JLabel("ZipCode");
    JTextField tzcode = new JTextField(10);
    JLabel cnum = new JLabel("Contact Number");
    JTextField tcnum = new JTextField(15);
    JLabel nod = new JLabel("Number Of Dependent");
    JTextField tnod = new JTextField(10);
    JButton sub = new JButton("Submit");
    JButton clear = new JButton("Clear");
    GridBagConstraints gbc = new GridBagConstraints();
    GridBagLayout gbl = new GridBagLayout();

    
    public CustomerInformation(Frame f){
	super(f, true);
        //setModal(true);
        gbc.fill = GridBagConstraints.NONE;
        gbc.anchor = GridBagConstraints.WEST;
        gbc.insets = new Insets(3, 5, 3, 5); 
        setLayout(gbl);
        tcid.setEditable(false);
        tcid.setText(generateId());
        heading.setForeground(Color.BLUE);
        heading.setFont(new Font("Arial", Font.BOLD, 22));

        JButton close = new JButton("Close");
        close.addActionListener(new ActionListener() {
           public void actionPerformed(ActionEvent e) {
              dispose();
           }
        });

        for(int i = 0; i <ccms.length; i++) {
            cms.addItem(ccms[i]);
        }

	for(int i = 0; i <= 31; i++) {
	d.addItem("" + i);
        }

	for(int i = 1940; i <= 20020; i++) {
	y.addItem("" + i);
        }
        for(int i = 0; i < mont.length; i++) {
            m.addItem(mont[i]);
        }
        addComponent(heading,  0, 0);
        addComponent(cid, 0, 1);
        addComponent(tcid, 1, 1);
        addComponent(name, 0, 2);
        addComponent(tname, 1, 2);
        addComponent(lname, 2, 2);
        addComponent(tlname,3,2);
        addComponent(dob, 0, 3);
        addComponent(d, 1, 3);
        addComponent(m, 2, 3);
        addComponent(y, 3, 3);
        addComponent(ms, 0, 4);
        addComponent(cms, 1, 4);
        addComponent(address, 0, 5);
        addComponent(taddress, 1, 5);
        addComponent(city, 0, 6);
        addComponent(tcity, 1, 6);
        addComponent(state, 0, 7);
        addComponent(tstate, 1, 7);
        addComponent(zcode, 0, 8);
        addComponent(tzcode, 1, 8);
        addComponent(cnum, 0, 9);
        addComponent(tcnum, 1, 9);
        addComponent(nod, 0, 10);
        addComponent(tnod, 1, 10);
        addComponent(sub, 0, 11);
        addComponent(clear, 1, 11);
        addComponent(close, 2, 11);
        sub.addActionListener(this);
        clear.addActionListener(this);
      
        getRootPane().setDefaultButton(sub);
       
    }

    public String generateId() {
      final String validChars = "0123456789";
      java.util.Random rnd = new java.util.Random();
      String id = "";
      for(int i = 0; i < 3; i++) {
         id += validChars.charAt(rnd.nextInt(validChars.length()));
      }
      return id;
   }

  private void addComponent(Component component, int row, int column){

    gbc.gridx = row;
    gbc.gridy = column;
    gbl.setConstraints(component, gbc);
    add(component);
   }
   
   public void actionPerformed(ActionEvent ae) {
 if(ae.getSource() == clear){
     
        tname.setText("");
      tlname.setText("");
      taddress.setText("");
      tcity.setText("");
      tstate.setText("");
      tzcode.setText("");
      tcnum.setText("");
      tnod.setText("");
      cms.setSelectedIndex(0);
      d.setSelectedIndex(0);
      m.setSelectedIndex(0);
      y.setSelectedIndex(0);
   }
   if(ae.getSource() == sub) {
try{
   System.setSecurityManager(new java.rmi.RMISecurityManager());
    Registry registry = LocateRegistry.getRegistry("localhost", 1099);
    CustomerInformationServer chi = (CustomerInformationServer)registry.lookup("CustomerInformationServer");
            System.out.println("Services available."); 
          
           String cid = tcid.getText();
           String name = tname.getText();
           String lname = tlname.getText();
           String city = tcity.getText();
           String state = tstate.getText();
           int code = Integer.parseInt(tzcode.getText());
           String cnum = tcnum.getText();
           String address = taddress.getText();int nod = Integer.parseInt(tnod.getText());
           String  cms1 = String.valueOf(cms.getSelectedItem());
           String dateOfBirth = d.getSelectedItem() + "/" + m.getSelectedItem() + "/" + y.getSelectedItem();
            String result = ci.insertDetails(cid, name, dateOfBirth,
            String.valueOf(cms.getSelectedItem()), address, city, state , zcode, cnum, nod);
            String day = String.valueOf(d.getSelectedItem());
            String month = String.valueOf(m.getSelectedItem());
            String year = String.valueOf(y.getSelectedItem());
            String ms = String.valueOf(cms.getSelectedItem());
            String dob = year + "-" + (m.getSelectedIndex() + 1) + "-" + day;

            System.out.println("Services not found.");
        } catch(java.rmi.NotBoundException e) {
           
        } catch(Exception e) {e.printStackTrace();}
            System.out.println("An unknown error occurred");
            
          if(name.equals("")){
            JOptionPane.showMessageDialog(this, "customer name cannot be blank");
            return;
            }
           
          if(address.equals("")){
               JOptionPane.showMessageDialog(this, "Please Enter your Address");
               return;
            }
            
           if(city.equals("")){
              JOptionPane.showMessageDialog(this, "City cannot be blank");
              return;
            }
          
            if(state.equals("")){
               JOptionPane.showMessageDialog(this, "Please Enter your State");
               return;
            }
            if (tzcode.equals("")){
               JOptionPane.showMessageDialog(this, "Please Enter your ZipCode");
               return;
               }

              if(cnum.equals("")){
               JOptionPane.showMessageDialog(this, "Please Enter your Contact Number");
              return;
              }
   }
}
}

what errors?

what errors?

at the insert stage ci.insertDetails, the compiler keeps telling me this

please man i need help, i have been on this for weeks.

Last login: Sun Jan 31 21:18:31 on ttyp1
Welcome to Darwin!
dial-pool72:~ ingeborgboddeke$ cd desktop
dial-pool72:~/desktop ingeborgboddeke$ cd javaline
dial-pool72:~/desktop/javaline ingeborgboddeke$ javac CustomerInformation.java
CustomerInformation.java:164: insertDetails(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,int) in CustomerInformationServer cannot be applied to (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.swing.JLabel,java.lang.String,int)
String result = chi.insertDetails(cid, name, dateOfBirth,
^
1 error
dial-pool72:~/desktop/javaline ingeborgboddeke$

1.
      String result = ci.insertDetails(cid, name, dateOfBirth,
   2.
      String.valueOf(cms.getSelectedItem()), address, city, state , zcode, cnum, nod);
   3.
      String day = String.valueOf(d.getSelectedItem());
   4.
      String month = String.valueOf(m.getSelectedItem());
   5.
      String year = String.valueOf(y.getSelectedItem());
   6.
      String ms = String.valueOf(cms.getSelectedItem());
   7.
      String dob = year + "-" + (m.getSelectedIndex() + 1) + "-" + day;

CustomerInformation.java:164: insertDetails(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,int) in CustomerInformationServer cannot be applied to (java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.swing.JLabel,java.lang.String,int)
String result = chi.insertDetails(cid, name, dateOfBirth,

The error tells you exactly what you need to fix. Look carafully how you declare the insertDetails and how you are calling it

thanks but that's why i seek for help, i am not as good as you are so please just help out ok.

thanks but that's why i seek for help, i am not as good as you are so please just help out ok.

Compare these:
insertDetails(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,int,java.lang.String,int)

insertDetails(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,javax.swing.JLabel,java.lang.String,int)

One is the declaration. Don't you know you should call methods with the arguments they are declared.

You are not calling with the right arguments. Check the declaration and call it with the right arguments

thanks i will check it out.

i dont know i still cannot find the problem?? its killing me. hah

As I said:

You are not calling it with the right arguments. Check the declaration and call it with the right arguments

When you declare a method you need to call it with the number and type of arguments that was declared.

commented: thanks for all your help man. +3

okay thank, i got another question...

am i suppose to pass the label fields as argument or the text fields??

am i suppose to pass the label fields as argument or the text fields??

What are the arguments of the method?

And on a more personal note, and don't take this the wrong way but it is true and lots of people will agree with me:
The title of this thread is "Rmi database insert". And from the code I think you are trying to call some remote method: CustomerInformationServer.insertDetails.
Now it is clear that you lack the very basic: Calling methods. You don't even know how to call a single method and pass arguments to it and you are trying to do something like that? Shouldn't you first learn the basics and then do more complex stuff?

And if you tell me that you wrote that code and you know how to call methods, because it is true, you do that in your code, I will say that you need a lot more practice, because I can assure you: the error you get has nothing to do with RMI. It has to do with calling a single method with the right arguments,which is basic java.

The error tells you exactly what arguments the method takes, as some of the initial posts say, and you have been informed that you are calling the method with the wrong arguments.

So now you ask, if you should pass the label or the text fields. It is clear that, even though you wrote that entire code, which some parts of it could be taken from a book example, you do not know the basics of calling methods with the right arguments.

So it is better for you to take a step back and focus more on improving your skills, before trying to do things you shouldn't be doing.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.