I have a problem with doing insert
there in the PostgreSQL database. The code is apparently ok but at the time of compiling the error.
The error is related to the type of data that I try to insert into the database. The error it gives is:
error: incompatible types: java.util.Date can not be converted to java.sql.Date
This error appears for all date insertion rows.
modeloIntenrnacao.setDtAdmisPlano((jDateChooserDtAdmissPlano.getDate()));
modeloIntenrnacao.setNome(jTextFieldNomePaciente.getText());
modeloIntenrnacao.setMatricula(Integer.parseInt(jTextFieldMatricula.getText()));
modeloIntenrnacao.setDtAdmisPlano((jDateChooserDtAdmissPlano.getDate()));
modeloIntenrnacao.setHospOrig(jTextFieldHospOrig.getText());
modeloIntenrnacao.setId(jTextFieldId.getText());
modeloIntenrnacao.setIndicacao(jTextFieldindicacao.getText());
modeloIntenrnacao.setTipoInternac((String)jComboBoxTpInterna.getSelectedItem() );
modeloIntenrnacao.setTipoLeito((String)jComboBoxTpLeito.getSelectedItem());
modeloIntenrnacao.setIdadeAprox(Integer.parseInt(jTextFieldIdadeAprox.getText()));
modeloIntenrnacao.setDataInternac((jDateChooserdDtInternac.getDate()));
modeloIntenrnacao.setDataPrevAlta((jDateChooserdInterAlt.getDate()));
modeloIntenrnacao.setObservacoes(jTextAreaObservacoes.getText());
modeloIntenrnacao.setIdCodInternac(Integer.parseInt(jTextFieldIdInternacao.getText()));
controleInterna.salvaFormInternac(modeloIntenrnacao);