Subject HELP HELP HELP - FBException
Author Francisco Vieira
This EXECPTION is driving me crazy, I have a Stored Procedure (in fact I have 3 for the same operation, but I am using try and catch to check each one) with 30 arguments to INSERT in a table wich has 3 NOT NULL fields, one (the code) is INSERTED by a generator value incremented in the TRIGGER (AFTER INSERT TRIGGER), the name is ALWAYS typed and the last, the date, is taken from the system date, but I've got this exception message everytime (even when I fill in all the fields in the form):
 
org.firebirdsql.jdbc.FBSQLException: GDS Exception 
No message for code 335544347 found.
null
null
 
I just don't understand why this null null, there is nothing null, I mean what is supposed to be not null in the table has values coming in.
 
Just in case following is the code (the entire code is between another try catch block):
 
try{
p = c.prepareCall("{call CAD_TARIFA(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) }");
                    p.setString(1, textoNomeTarifa.getText());        
                    p.setDate(2, T.getNew().dataSQL(textoDataCadastro));        
                    p.setDouble(3, Double.parseDouble(textoTaxaSobreFrete.getText()));        
                    p.setDouble(4, Double.parseDouble(textoAliquotaICMS.getText()));        
                    p.setDouble(5, Double.parseDouble(textoAliquotaServicos.getText()));        
                    p.setDouble(6, Double.parseDouble(textoBaseDeCalculo.getText()));        
                    p.setDouble(7, Double.parseDouble(textoPorcentagem.getText()));        
                    p.setString(8, por_val);        
                    p.setString(9, textoTipoCarga.getText());        
                    p.setString(10, textoCidadeOrigem.getText());        
                    p.setString(11, (String)comboUFOrigem.getSelectedItem());        
                    p.setString(12, textoCidadeDestino.getText());        
                    p.setString(13, (String)comboUFDestino1.getSelectedItem());        
                    p.setDouble(14, Double.parseDouble(textoValorCAT.getText()));        
                    p.setDouble(15, Double.parseDouble(textoValorDespacho.getText()));        
                    p.setDouble(16, Double.parseDouble(valorOutros)); 
                    p.setDouble(17, Double.parseDouble(textoValorPedagio.getText()));        
                    p.setDouble(18, Double.parseDouble(textoValorPrestacao.getText()));        
                    p.setDouble(19, Double.parseDouble(textoValorGRIS.getText()));        
                    p.setDouble(20, Double.parseDouble(textoValorColeta.getText()));        
                    p.setDouble(21, Double.parseDouble(textoValorAutonomo.getText()));         
                    p.setDouble(22, Double.parseDouble(textoAliquotaCOFINS.getText()));        
                    p.setDouble(23, Double.parseDouble(textoAliquotaPIS.getText()));        
                    p.setDouble(24, Double.parseDouble(textoAliquotaIRPJ.getText()));        
                    p.setDouble(25, Double.parseDouble(textoAliquotaCSSL.getText()));        
                    p.setDouble(26, Double.parseDouble(textoAliquotaINSS.getText()));        
                    p.setDouble(27, Double.parseDouble(textoAliquotaDARF.getText()));        
                    p.setDouble(28, Double.parseDouble(textoDistancia.getText()));        
                    p.setInt(29, Integer.parseInt(textoPrazoEntrega.getText()));        
                    p.setString(30, textoObservacao.getText());        
                    p.execute(); 
                    textoNomeTarifa.setText("");
                    textoTaxaSobreFrete.setText("0.00");        
                    textoAliquotaICMS.setText("0.00");  
                    textoAliquotaServicos.setText("0.00");       
                    textoBaseDeCalculo.setText("0.00");
                    textoPorcentagem.setText("0.00"); 
                    textoTipoCarga.setText("");        
                    textoCidadeOrigem.setText("");        
                    textoCidadeDestino.setText("");        
                    textoValorCAT.setText("0.00");        
                    textoValorDespacho.setText("0.00");        
                    textoValorPedagio.setText("0.00");
                    textoValorPrestacao.setText("0.00");      
                    textoValorGRIS.setText("0.00");
                    textoValorColeta.setText("0.00");      
                    textoValorAutonomo.setText("0.00");      
                    textoAliquotaCOFINS.setText("0.00");     
                    textoAliquotaPIS.setText("0.00"); 
                    textoAliquotaIRPJ.setText("0.00");     
                    textoAliquotaCSSL.setText("0.00");    
                    textoAliquotaINSS.setText("0.00");    
                    textoAliquotaDARF.setText("0.00");    
                    textoDistancia.setText("0"); 
                    textoPrazoEntrega.setText("1");        
                    textoObservacao.setText("");                            
                    dados = true;
                    } catch (Exception e1) <<================ THE FIRST EXECPTION OCCURS HERE
                    {
                        T.getNew().Aviso("Erro nos dados principais", e1.toString());                       
                    }
                    
                    try
                    {
                    p = c.prepareCall("{call CAD_CIDADE_TARIFA(?, ?) }");
                    int tam = modeloCodigoSelecionado.size();
                    for(int i=0; i<tam; i++)
                    {
                        int codigo_tarifa = Integer.parseInt(textoCodigo.getText());
                        int codigo_cidade = Integer.parseInt((String)modeloCodigoSelecionado.get(i));
                        System.out.println("Codigo da Tarifa: "+codigo_tarifa);
                        System.out.println("Codigo da Cidade: "+codigo_cidade);
                       
                        p.setInt(1, codigo_cidade);
                        p.setInt(2, codigo_tarifa);
                        p.execute();
                        p.clearParameters();
                    }
                    T.getNew().Aviso(null, "CIDADES OK");
                    cidades = true;
                    } catch (Exception e2)
                    {
                        T.getNew().Aviso("Erro nas cidades", e2.toString());                       
                    }
 
                    int numRows = modTabValores.getRowCount();
                   
                    try
                    {
                    p = c.prepareCall("{call CAD_VALOR_TARIFA(?, ?, ?, ?, ?, ?) }");
                    for (int i=0; i < numRows; i++)
                    {
                       
                        int codigo = Integer.parseInt((String)tbValores.getValueAt(i,0)); // (1)
                        int linha = Integer.parseInt((String)tbValores.getValueAt(i,1)); // (2)
                        String tipo = ((String)tbValores.getValueAt(i,2)).substring(0,1); // (3)
                        double inicio = Double.parseDouble((String)tbValores.getValueAt(i,3)); // (4)
                        double fim = Double.parseDouble((String)tbValores.getValueAt(i,4)); // (5)
                        double valor = T.getNew().deMoedaParaDouble((String)tbValores.getValueAt(i,5)); // (6)
                        p.setInt(1, codigo);
                        p.setInt(2, linha);
                        p.setString(3, tipo);
                        p.setDouble(4, inicio);
                        p.setDouble(5, fim);
                        p.setDouble(6, valor);
                        p.execute(); // executa a entrada para cada linha
                        p.clearParameters();
                    }
                    valores = true;
                    } catch (Exception e3)
                    {
                        T.getNew().Aviso("Erro nos VALORES", e3.toString());                       
                    }