getCatalogs() and getTables()

Edson Carlos Ericksson Richter richter at viaapia.com.br
Thu Jul 13 11:25:48 EDT 2000


Are you using NT 4 with Service Pack 6? I have ear someone with problems due to modifications made by Microsoft into TCP/IP stack in SP 6...

Use NT 4 with SP 5 (Bad news: I think that you will need to reinstall all...).

When I have some time, I'll try do these tests with NT4+SP6a

Edson Richter

  ----- Original Message ----- 
  From: Stephanie Lewis 
  To: TDS Development Group 
  Sent: Thursday, July 13, 2000 11:15 AM
  Subject: [freetds] Re: getCatalogs() and getTables()


  Greg, 
          I downloaded the  "freetds_jdbc.snapshot.zip  233 Kb    Thu Jul 06 11:12:00 2000 Zip Compressed Data" source and compiled it. I am in fact running the drivers on NT 4 workstation. 
  Greg Garrison wrote: 

    Stephanie - Noticed your post. Sorry I don't have an answer for your problem but 
    I would like to ask you if you have been successful at running these drivers on 
    NT 4.0.  We are having a problem.  They run fine on our linux or sun servers but 
    not on NT4. If so, which build or JAR are you using?  Much appreciated! 
    ---------------------- Forwarded by Greg Garrison/JEFCO on 07/13/2000 09:23 AM 
    --------------------------- 
    Stephanie Lewis <slewis at thinweb.com> on 07/13/2000 08:38:44 AM 

    Please respond to "TDS Development Group" <freetds at franklin.oit.unc.edu> 

    To:   "TDS Development Group" <freetds at franklin.oit.unc.edu> 
    cc:    (bcc: Greg Garrison/JEFCO) 

    Subject:  [freetds] getCatalogs()  and getTables() 

    Hi there, 
           I have the July 6/00 download of the JDBC source compiled.. I'm 
    connecting to an SQL Server 7.0 and all standard queries work fine. 
    However, I can't get the DatabaseMetaData getTables() to work. It calls 
    getCatalogs() which throws an exception here: 

    public java.sql.ResultSet getCatalogs() 
       throws SQLException 
       { 
       // XXX We should really clean up all these temporary tables. 
       String tmpName = "#t#" + UniqueId.getUniqueId(); 
       final String sql = 
       " create table " + tmpName + "                                   " + 
       " (                                                              " + 
       "    q  char(30) not null,                                       " + 
       "    o  char(30) null,                                           " + 
       "    n  char(30) null,                                           " + 
       "    t  char(30) null,                                           " + 
       "    r  varchar(255) null                                        " + 
       " )                                                              " + 
       "                                                                " + 
       " insert into " + tmpName + " EXEC sp_tables ' ', ' ', '%', null " + 
       "                                                                " + 
       " select q from " + tmpName + "                                  " + 
       ""; 
       java.sql.Statement   stmt = connection.createStatement(); 
       java.sql.ResultSet   rs; 

       if (stmt.execute(sql)) 
       { 
       throw new SQLException("Internal error.  Confused"); 
       } 

       // Eat the data returned by the 'create table' 
       if (null != (rs = stmt.getResultSet())) 
       { 
       throw new SQLException("Internal error.  Confused"); 
       } 

       // Eat the data returned by the 'insert' 
       if (null != (rs = 
    stmt.getResultSet())) 
    <<<<<<<<<<--------------------------------EXCEPTION THROWN HERE! 
       { 
       throw new SQLException("Internal error.  Confused.  Was expecting a 
    result set."); 
       } 

       // now get the result set 
       if (null == (rs = stmt.getResultSet())) 
       { 
       throw new SQLException("Internal error.  Confused"); 
       } 
       return rs; 
       } 

    Are these implementations of these methods supposed to work or are they 
    a work in progress? Any thoughts. 

    Hope you can provide some insight, 
                                                            Stephanie 

      ------------------------------------------------------------------------ 
                      Name: att1.htm 
       att1.htm       Type: Hypertext Markup Language (text/html) 
                  Encoding: base64 
               Description: Internet HTML

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ibiblio.org/pipermail/freetds/attachments/20000713/3403eade/attachment.html 


More information about the FreeTDS mailing list