[Driver ODBC para dBase] Número excessivo de tarefas de cliente.

"Jonny Marques" <[email protected]>
Newsgroups gmane.comp.db.bancosdedados
Message-ID <[email protected]>
Olá pessoal,

   Fiz uma classe com conexão a um dbf via odbc. O mesmo funciona
perfeitamente. Porém ao criar uma classe que importa dados de um txt
(linha por linha) ele dá o seguinte erro: [Microsoft][Driver ODBC para
dBase] Número excessivo de tarefas de cliente.

   Para facilitar a compreensão segue abaixo o método:

    boolean isMatricula = false;

    ISQLDataReader sdr = new SQLDataReader();
    PortalParam pp = new PortalParam();
    Dbase dbf = new Dbase(urlDbf);;
    String urlDbf = pp.getUrlDbf();

    // capturando dados do arquivo txt
    CadastroObj obj = new CadastroObj();
    String mat = new String();
    long inicio = System.currentTimeMillis();
    BufferedReader in = new BufferedReader(new FileReader(
        "c:\\dbf\\cadastro.txt"));
    String line;
    int linha = 1;

    while ((line = in.readLine()) != null) {
        if (linha > 2 && linha < 4000) {

        mat = "0" + line.substring(0, 10).trim() + "." + line.substring
(10, 11);
        obj.setMatricula(mat);
        obj.setLocaliz(line.substring(12, 22));
        obj.setNome(line.substring(69, 99));
        obj.setEndereco(line.substring(100, 150));
        obj.setSituacao(line.substring(151, 162));

        /* verificando dados no banco */
        dbf.connectDb();
        sdr = dbf.sqlResultDb("select * from cadastro where
matricula='" + mat
                + "'");
        isMatricula = sdr.count() > 0;
        // atualiza em bando de dados
        dbf.disconnectDb();
        if (isMatricula) {
        }
        System.out.println(isMatricula + ",lin:" + linha + " :|" +
mat);

        }
        linha++;
    }
    in.close();

E a mensagem completa é:

java.sql.SQLException: [Microsoft][Driver ODBC para dBase] Número
excessivo de tarefas de cliente.
        at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcConnection.initialize(Unknown Source)
        at sun.jdbc.odbc.JdbcOdbcDriver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at java.sql.DriverManager.getConnection(Unknown Source)
        at vetor.com.br.jdbc.AcessBD.openDb(AcessBD.java:31)
        at vetor.com.br.jdbc.Dbase.connectDb(Dbase.java:16)
        at vetor.com.br.jdbc.Dbase.sqlResultDb(Dbase.java:22)
        at vetor.com.br.Teste.main(Teste.java:59)
Exception in thread "main" java.lang.NullPointerException
        at vetor.com.br.jdbc.AcessBD.consultSql(AcessBD.java:67)
        at vetor.com.br.jdbc.SQLCommand.consult(SQLCommand.java:14)
        at vetor.com.br.jdbc.Dbase.sqlResultDb(Dbase.java:23)
        at vetor.com.br.Teste.main(Teste.java:59)

Quem souber como resolver o problema, ficarei muito grato.

Att. Jonny Marques
Programador Web
Vetor Informática (SergipeTec)

PS.: Como sempre tenho pesquisado no google, mas não tenho encontrado,
ainda, uma resposta consistente.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.