Boa noite pessoal..venho postar meu código pra ver se alguem consegue enxergar o que está acontecendo...
Tenho uma classe para conexão com o banco...e quando chamo ela não consigo gravar...em uma outra classe consegui...mas não fiz nada de diferente.
Vou postar primeiro a classe CONEXAO e abaixo a classe WFDIGPED ok.
Desde ja agradeço.
CLASSE DA TELA
package Digitacoes;
import java.sql.SQLException;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;
import util.dataFormatada;
import util.conexao2;
/**
*
* @author Felipe
*/
public class WFDIGPED extends javax.swing.JFrame {
//Variaveis para calculo do total convertido.;
conexao2 conecta2;
/** Creates new form WFDIGPED */
public WFDIGPED() {
initComponents();
this.setLocationRelativeTo(null);
this.lookandfeel();
dataFormatada data = new dataFormatada();
data.leDataFormatada();
data_pedido.setText(data.dtFormatada);
this.estadoInicial();
conecta2 = new conexao2();
conecta2.conectaBanco2();
}
private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
if(end_cliente.getText().length()==0 ||
cliente_pedido.getText().length()==0 ||
cidade_evento.getText().length()==0 ||
evento_pedido.getText().length()==0 ||
data_evento.getText().length()==0){
JOptionPane.showMessageDialog(null,"Preencha todos os campos obrigatórios '*'!",
"Mensagem",JOptionPane.INFORMATION_MESSAGE);
}
else
{
try
{
String update = "INSERT INTO \"public\".\"UPEDFOTO\"(" +
"\"PED_EMP\"," +
"\"PED_SETOR\"," +
//"\"PED_COD\"," +
"\"PED_DATA\"," +
"\"PED_PES\","+
"\"PED_END_CLI\","+
"\"PED_NUM_CLI\","+
"\"PED_MUNIC_CLI\","+
"\"PED_CPF_CLI\","+
"\"PED_RG_CLI\","+
"\"PED_EVENT\","+
"\"PED_MUNIC_EVENT\","+
"\"PED_DT_EVENT\","+
"\"PED_QUANT_1015\","+
"\"PED_QUANT_1318\","+
"\"PED_QUANT_1521\","+
"\"PED_QUANT_2025\","+
"\"PED_QUANT_2030\","+
"\"PED_VLR_TOTAL\")"+
//"\"PES_OBS\")"+
"VALUES('"+
Integer.parseInt(pedido_empresa.getText())+"','"+
Integer.parseInt(pedido_setor.getText())+"','"+
data_pedido.getText()+"','"+
//Integer.parseInt(numero_pedido.getText())+"','"+
cliente_pedido.getText()+"','"+
end_cliente.getText()+"','"+
Integer.parseInt(num_end_cliente.getText())+"','"+
cidade_cliente.getText()+"','"+
cpf_cliente.getText()+"','"+
rg_cliente.getText()+"','"+
evento_pedido.getText()+"','"+
cidade_evento.getText()+"','"+
data_evento.getText()+"','"+
quant_1015.getText()+"','"+
quant_1318.getText()+"','"+
quant_1521.getText()+"','"+
quant_2025.getText()+"','"+
quant_2030.getText()+"','"+
Float.parseFloat(total_encomenda.getText())+"')";
//areaObs.getText()+"')";
int executeUpdate = conecta2.st.executeUpdate(update);
JOptionPane.showMessageDialog(null,"Dados inseridos com sucesso!");
}
catch(NullPointerException numberFormat){
JOptionPane.showMessageDialog(null,"Mensagem.: "+numberFormat.getMessage());
}
catch(SQLException e){
JOptionPane.showMessageDialog(null,"Mensagem.: "+e.getMessage());
}
}