era pra ser Mr. Beans!
rs…
[code]public void adiciona(CadContrato c1) throws SQLException, ParseException
{
//Prepara a conexão
String sql = “INSERT INTO cad_contratos (id_obra,id_contrato,contratada,servico,budget,”+
“valor_contrato,valor_fat_direto,valor_sinal,reter_sinal,ret_contratual,cadastro,emissao,anexo)”+
“VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)”;
PreparedStatement stmt = conexao.prepareStatement(sql);
//Preenche os valores
stmt.setString(1, c1.getObra());
stmt.setString(2, c1.getId_contrato());
stmt.setString(3, c1.getContratada());
stmt.setString(4, c1.getServico());
stmt.setDouble(5, c1.getBudget());
stmt.setDouble(6, c1.getValor_contrato());
stmt.setDouble(7, c1.getValor_fat_direto());
stmt.setDouble(8, c1.getValor_sinal());
stmt.setBoolean(9, c1.getReter_sinal());
stmt.setFloat(10, c1.getRet_contratual());
stmt.setDate(11, new Date(c1.getCadastro().getTime()));
stmt.setDate(12, new Date(c1.getEmissao().getTime()));
//stmt.setDate(8, new Date(c1.getTermino_previsto().getTime()));
//stmt.setDate(9, new Date(c1.getEnvio_juridico().getTime()));
//stmt.setDate(10, new Date(c1.getRetorno_assinado().getTime()));
//stmt.setDate(11, new Date(c1.getEncerramento().getTime()));
//stmt.setString(12, c1.getObservacoes());
stmt.setBlob(13, c1.getAnexo());
//Executa e fecha
stmt.execute();
stmt.close();
}[/code]