Pessoal estou com dificuldade em dar um insert no banco Oracle, pegando as informações de um xls.
A estrutura da tabela é a seguinte!
create tablergd.stop_atis_daniel(null,
cd_cliente number null,
cd_conta number null,
qtde number null,
valor decimal(12,2)
motivo varchar2(50) null,
conta number null,
ciclo number null,
terminal number null)
O código que estou usando para inserir a informação é a seguinte:
public class StopAtis {
private static int i;
private static int stringa1 ;
private static int stringa2 ;
private static int stringa3 ;
private static String stringa4 = null;
private static String stringa5 = null;
private static int stringa6 ;
private static int stringa7;
private static int stringa8;
/**
* @param args the command line arguments
*/
public static void main(String []args) throws BiffException, IOException, SQLException{
System.out.println("Conectando ao Banco");
Connection con = new ConnectionFactory().getConnection();
GerarTxt gerarTxt = null;
Workbook workbook = Workbook.getWorkbook(new File("C:/teste/stop_atisciclo02345.xls"));
Sheet sheet = workbook.getSheet(0);
int linhas = sheet.getRows();
for(i = 1; i < linhas; i++){
Cell a1 = sheet.getCell(0,i);
Cell b2 = sheet.getCell(1,i);
Cell c3 = sheet.getCell(2,i);
Cell d4 = sheet.getCell(3,i);
Cell e5 = sheet.getCell(4,i);
Cell f6 = sheet.getCell(5,i);
Cell g7 = sheet.getCell(6,i);
Cell h8 = sheet.getCell(7,i);
stringa1 = Integer.valueOf(a1.getContents());
stringa2 = Integer.valueOf(b2.getContents());
stringa3 = Integer.valueOf(c3.getContents());
stringa4 = d4.getContents();
stringa5 = e5.getContents();
stringa6 = Integer.valueOf(f6.getContents());
stringa7 = Integer.valueOf(g7.getContents());
stringa8 = Integer.valueOf(h8.getContents());
PreparedStatement st = con.prepareStatement("insert into rgd.stop_atis_daniel(cd_cliente,cd_conta,qtde,valor,motivo,conta,ciclo,terminal)"+"Values('"+stringa1+"','"+stringa2+"','"+stringa3+"','"+stringa4+"','"+stringa5+"','"+stringa6+"','"+stringa7+"','"+stringa8+"')");
st.executeUpdate();
System.out.println("Importando!!!!");
}
}
}
e esta dando o seguinte erro!!!
Alguém poderia me ajudar nesse erro!!!
o que posso estar fazendo errado!?