Java conectar firebird arquivo FDB

0 respostas
fabiodurgante

tenho um arquivo FDB firibird quero fazer insert apartir de um arquivo excell fiz o seguinte para ler o arquivo excell leu corretamente, ex coluna1 nome coluna 2 endereço coluna 3 telefone…

import java.io.File;

import java.io.IOException;

import jxl.Cell;

import jxl.NumberCell;

import jxl.Sheet;

import jxl.Workbook;

import jxl.read.biff.BiffException;

import javax.swing.JOptionPane;





/**
 *
 * @author Humberto
 */
public class LerExcell {

    /**
     * @param args the command line arguments
     */
 public static void main(String[] args) throws IOException, BiffException {

Workbook workbook = Workbook.getWorkbook(new File("base.xls"));


Sheet sheet = workbook.getSheet(0);

int linhas = sheet.getRows();

System.out.println("Iniciando a leitura da planilha XLS:");

      for(int i = 0; i < linhas; i++){


Cell a1 = sheet.getCell(0, i);

Cell a2 = sheet.getCell(1, i);

Cell a3 = sheet.getCell(2, i);
Cell a4 = sheet.getCell(3, i);
Cell a5 = sheet.getCell(4, i);
Cell a6 = sheet.getCell(5, i);


String as1 = a1.getContents();
String as2 = a2.getContents();
String as3 = a3.getContents();
String as4 = a4.getContents();
String as5 = a5.getContents();
String as6 = a6.getContents();


System.out.println("Coluna 1: " + as1);
System.out.println("Coluna 2: " + as2);
System.out.println("Coluna 3: " + as3);
System.out.println("Coluna 4: " + as4);
System.out.println("Coluna 5: " + as5);
System.out.println("Coluna 6: " + as6);
System.out.println("---------------- ");

}      

workbook.close();

}
}

como poderia fazer a conexao com o arquivo FDB do firbird e fazer um insert na tabela ???

Criado 23 de setembro de 2013
Respostas 0
Participantes 1