-1
I’m having trouble with the foreign key. I have a company record and in this register I put 3 foreign keys, which is that such relationship 1:n, right?
Anyway, I can only put the columns on the table itself, but when it’s the foreign key I can’t.
//Metodo de cadastro
public void cadastroempresa(CadastroEmpresa Cadastro){
SQL....
prepared...
pst.setString(1, Cadastro.getNomeEmpresa());
pst.setString(2, Cadastro.getCnpjEmpresa());
pst.setString(3, Cadastro.getNomeResponsavel());
// A linha abaixo é a fk de outra tabela que tá dando erro.
// Essa fk tá dentro de um combobox já preenchido com os dados
pst.setInt(4,Cadastro.getfkestado());
}
but what’s the mistake?
– Lucas Miranda
Do you agree that "making a mistake" offers little chance for anyone to try to help you? What error? Which error message appears to you?
– StatelessDev
I was able to fix it, I wasn’t able to put the foreign key in the method
– Lorita 0800