Como pegar um xls e subir para o banco!?

Pessoal preciso de uma ajuda!!!
Preciso pegar um xls e subir para o banco, a conexao com o banco consigo de boa , mas como pegar as informações do xls que estao em colunas e subir para o banco!?
alguém poderia me ajuda por favor!?

grato a todos.

Olá amigo…
Vê se te ajuda!

pelo que vi, o cara desenvolveu uma api eu gostaria de fazer diferente disso!!
algo mais fácil

achei algo interessante, mas assim que fizer o tste eu coloco aqui blz

http://www.guj.com.br/java/31858-ler-de-planilha-no-excel-e-passar-para-banco-de-dados

Você precisa subir o conteúdo do xls ou o arquivo xls?

Se precisar ler o conteúdo do xls use o Apache POI msmo. e como é XLS provavelmente você vai usar a classe HSSF.

ùltimamente passei por isso, qualquer cosia só da um grito

ssh blz!!
Não entendi, quando quiz dizer o conteúdo e o arquivo?!
mas acho que seria o conteúdo, pegar cada linha e os campos e popular no banco de dados

Pessoal seguinte, conseguir fazer, porém quero saber se existe outra forma de fazer?! se tem outra mas fácil!?

package lerexcell;

/**
 *
 * @author dsantan
 */
import java.io.File;  
import java.io.IOException;  
import java.sql.Connection;  
import java.sql.DriverManager;  
import java.sql.PreparedStatement;  
import java.sql.SQLException;  
import java.util.Date;  
import jxl.Cell;  
import jxl.DateCell;  
import jxl.NumberCell;  
import jxl.Sheet;  
import jxl.Workbook;  
import jxl.read.biff.BiffException;  
  
  
  
public class LerExcell {  
      
    private static Connection conn;  
    private static int i = 0;  
    private static String stringa1;  
    private static String stringb2;  
    private static String stringc3;  
    private static String stringd4;  
    private static String stringe5;  
    private static String stringf6;  
    private static String stringg7;  
    private static String stringh8;  
    private static String stringi9;  
    private static String stringj10;  
    private static String stringl11;  
    
    /** Creates a new instance of Main */  
    public static void main(String[] args ) throws IOException, BiffException,ClassNotFoundException, SQLException {  
       
     //Conexão com o banco de dados  
     Class.forName("org.postgresql.Driver");  
     Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5432/postgres","usuario","senha");    
       
      /* pega o arquiivo do Excel */  
      Workbook workbook = Workbook.getWorkbook(new File("/home/dsantan/Documentos/teste.xls"));    
        
      /* pega a primeira planilha dentro do arquivo XLS */  
      Sheet sheet = workbook.getSheet(0);   
       
      //Pega a quantidade de linhas da planilha  
      int linhas = sheet.getRows();  
        
        
      for(i = 0; i < linhas; i++){  
      /* pega os valores das células como se numa matriz */  
      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);  
      Cell i9 = sheet.getCell(8,i);  
      Cell j10 = sheet.getCell(9,i);  
      Cell l11 = sheet.getCell(10,i);  
  
      /* pega os conteúdos das células */  
      stringa1 = a1.getContents();  
      stringb2 = b2.getContents();  
      stringc3 = c3.getContents();    
      stringd4 = d4.getContents();  
      stringe5 = e5.getContents();  
      stringf6 = f6.getContents();  
      stringg7 = g7.getContents();  
      stringh8 = h8.getContents();  
      stringi9 = i9.getContents();  
      stringj10 = j10.getContents();  
      stringl11 = l11.getContents();  
        
     /*Executa o insert para inserir os dados no banco de testes MySQL */       
     PreparedStatement ps = conn.prepareStatement("INSERT INTO javaxls(nome,endereco,cpf,rg,curso,professor,sala,materia,nota1,nota2,nota3) "+  
             "VALUES('"+stringa1+"','"+stringb2+"','"+stringc3+"','"+stringd4+"','"+stringe5+"'" +  
          "         ,'"+stringf6+"','"+stringg7+"','"+stringh8+"','"+stringi9+"','"+stringj10+"'" +  
          "         ,'"+stringl11+"')");  
           
     ps.executeUpdate();   
     }  
     workbook.close();  
    }      
}  

Se descobrir me avisa, eu sei que a biblioteca displaytag ajuda na exportação, mas para importação dos dados. não conheço.

Bom quando eu fiz eu elaborei dessa forma, criando um txt para rodar no banco mas dai vc
faz o seguinte ao invés de criar um txt vc faz diretamente com o banco ok:

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.OutputStreamWriter;

import javax.swing.JOptionPane;

import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;

/**
 * Gerador_Insert_SQL - Gera sql apartir de arquivos Excel com extensão .xls
 * 
 * @author master
 * 
 */
public class Gerador_Insert_SQL {
	private static String CAMINHO_ARQ_EXCEL = "Informe o arquivo caminho do arquivo excel";
	private static String CAMINHO_ARQ_BACKUP_TXT = "Informe o caminho e o nome do aquivo de backup";
	private static String TABELA_COMANDO = "INSERT INTO tabela (col1, col2, col3...)";
	private static int ABA_PLANILHA = 0;//Zero corresponde à primeira aba e assim consecutivamente.

	public static void main(String[] args) throws BiffException, IOException {
		File file = new File(CAMINHO_ARQ_EXCEL);

		if (file.exists()) {

			/* pega o arquivo do Excel */
			Workbook workbook = Workbook.getWorkbook(file);

			/* pega a primeira planilha dentro do arquivo XLS */
			Sheet sheet = workbook.getSheet(ABA_PLANILHA);

			/* pega os valores das células como se fosse numa matriz */
			int linhas = sheet.getRows();
			
			Cell[] celulas;
			
			StringBuffer sql = new StringBuffer("");
			
			System.out.println("Gerando Arquivo...");

			for (int i = 0; i < linhas; i++) {
				// monta o SQL
				sql.append(TABELA_COMANDO);
				sql.append(" VALUES(");
				
				celulas = sheet.getRow(i);
				
				// para cada célula na linha
				for (int j = 0; j < celulas.length; j++) {
					
					// pega o valor da célula e coloca no SQL
					sql.append("'" + celulas[j].getContents() + "'");
					
					// não adiciona a vírgula no último valor do sql
					if (j != celulas.length - 1) 
						sql.append(",");
				}
				sql.append(");\n");
			}//END FOR

			//Criando arquivo txt com os dados do insert.
			File fileTxt = new File(CAMINHO_ARQ_BACKUP_TXT);
			// Se o Aquivo não existir irá ser criado.
			if (!fileTxt.exists()) {
				OutputStream os = new FileOutputStream(fileTxt);
				OutputStreamWriter osw = new OutputStreamWriter(os);
				BufferedWriter bw = new BufferedWriter(osw);

				bw.write(sql.toString());
				bw.close();
				System.out.println("Arquivo Gerado Com Sucesso");
			} else {
				System.out.println("Arquivo de texto já existe");
			}
		} else {
			System.out.println("ARQUIVO EXCEL NÃO EXISTE");
		}
	}
}

Flw.