Skip to Content.
Sympa Menu

freetds - Re: getCatalogs() and getTables()

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Stephanie Lewis <slewis AT thinweb.com>
  • To: Greg Garrison <ggarriso AT jefco.com>, TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: getCatalogs() and getTables()
  • Date: Thu, 13 Jul 2000 11:15:35 -0300

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




Archive powered by MHonArc 2.6.24.

Top of Page