Error I do not select the department combo when searching for the id of the province

1

String[] opciones={"Codigo","Nombre"};
    String n1= (String) JOptionPane.showInputDialog(this,"Elija Opciones ","Buscar Empleado",JOptionPane.INFORMATION_MESSAGE,null,opciones,opciones[0]);
    if(n1.equalsIgnoreCase("Codigo"))
    {
        opc1=JOptionPane.showInputDialog("Ingrese El Codigo de la Provicnia ");

          try {
             cts=cn.prepareCall("{call SP_BUSC_PROVINCIA(?,?)}");
            cts.setString(1, opc1);
            cts.setString(2,opc2);
            r=cts.executeQuery();
            if(r.next()){           
            JOptionPane.showMessageDialog(this,"Provincia Encontrado!!","Aviso",JOptionPane.INFORMATION_MESSAGE);
            this.TXTCOD.setText(r.getString(1));
            this.TXTPROV.setText(r.getString(2));
            this.CBODEPARTAMENTO.setSelectedItem(r.getString(3));
    
asked by Daniel 06.05.2018 в 18:37
source

0 answers