Skip to Content.
Sympa Menu

freetds - Re: [freetds] Squirrel JDBC-ODBC Bridge and freeTDS ODBC

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Frediano Ziglio <freddyz77 AT tin.it>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Squirrel JDBC-ODBC Bridge and freeTDS ODBC
  • Date: Tue, 01 Nov 2005 20:39:09 +0100

Il giorno mar, 01/11/2005 alle 12.22 -0500, Pickett, David ha scritto:
> Vitaly,
>
> I did test OK with tsql and unixODBC isql (I linked mine to the name isqlo
> to sidestep the Interbase one). I tried the SQuirreL SQL window again, and
> now I am getting sp_help, sp_tables OK, but still no Objects Tree. For your
> command suggestions, I get:
> -------------------------------------------------------------------
> tdas-srv2:9:pts/127 /export/home/uabdp3
> $ tsql -C
>
> Compile-time settings (established with the "configure" script):
> Version: freetds v0.63
> MS db-lib source compatibility: no
> Sybase binary compatibility: unknown
> Thread safety: yes
> iconv library: yes
> TDS version: 5.0
> iODBC: no
> unixodbc: yes
> tdas-srv2:9:pts/127 /export/home/uabdp3
> $ isqlo --version
> unixODBC 2.2.7
> tdas-srv2:9:pts/127 /export/home/uabdp3
> $
> ----------------------------------------------------------------------------
> --
>
> (Nice to have thread safety, I guess due to some fluke of build environment
> states, but in ODBC, can you trust all callers to be MTSafe?)
>

Just use a connection in a single thread. If this is a limit use thread
options in unixODBC, it do a good job making any driver full thread
safe.

> Maybe I need to configure TDS Version to 8.0 somewhere. I was a bit
> surprised that the TDS Version is not something discovered or negotiated,
> but I guess we are where we are! I guess I can make it over or set an ENV
> var. I wanted to cycle SQuirreL anyway, to save the configuration before it
> crashed:
>
> ----------------------------------------------------------------
> Environment Variables
> .
> .
> .
>
> TDSVER
> governs the version of the TDS protocol used to connect to your server. For
> a given server, FreeTDS inspects four sources in the following order to
> determine which TDS protocol version to use, using the first one it finds.
>
> 1. The value specified in TDSVER
>
> 2. A freetds.conf file entry (see below)
>
> 3. The interfaces file entry (see below)
>
> 4. The --with-tdsver option passed to configure
> --------------------------------------------------------------------------
>
> This seems to contradict the following doc fragment, where it seems to also
> be an ODBC parameter in ~/.odbc.ini, but now I wonder, in ODBC, is the
> environment variable TDSVER in play? These doc entries need adjustment to

Well, odbc.ini (or ~/.odbc.ini) is point ... 1.5 !
You are right, perhaps is not easy to understand this for documentation.

> agree:
> -------------------------------------------------------------------------
> Table 4-1. Connection attributes
>
> Name Meaning
> Possible Values Default
> In odbc.ini
> .
> .
> .
> TDS_Version TDS protocol version to use (e.g., 5.0, 7.0). Any valid
> protocol version Depends on the TDS version specified with
> configure yes
> ----------------------------------------------------------------------
>
> I see TDS_Version was already set to 8.0 in .odbc.ini:
> ----------------------------------------------
> [Macola1Free]
> Driver = FreeTDS
> Description = FreeTDS driver
> Server = phlxsql03.phlx.net
> Port = 1433
> Database = master
> User =
> Password =
> Trace = No
> TDS_Version = 8.0

User and Password are useless (and not used) other entries are correct.

> ---------------------------------
> I tried SQuirreL with TDSVER=8.0 in the environment as well, and it does not
> help the Objects Tree. Maybe I have a less viable version of SQuirreL (2.0
> rc1)!
>
> When it fails, the log window says:
> --------------------
> Error: Macola1_Free_ODBC: java.sql.SQLException: [unixODBC][FreeTDS][SQL
> Server]The database name component of the object qualifier must be the name
> of the current database.
> --------------------
> and the catalog widget, where a SQL Server DB name should be visible, is
> blank, so I think the problem is something to do with identifying the right
> "database.owner.object" during metadata extraction.
>

Mmm... it can be raised from some internal store procedure. Try to set
Database entry with name of the database you are using. Also you can try
to enable odbc log and/or freetds one for more informations.

> The jdbcdebug.log says:
> ----------------------------------
> *Driver.connect (jdbc:odbc:Macola1Free)
> JDBC to ODBC Bridge: Checking security
> No SecurityManager present, assuming trusted application/applet
> JDBC to ODBC Bridge 2.0001
> Current Date/Time: Tue Nov 01 10:36:18 GMT-05:00 2005
> Loading JdbcOdbc library
> Allocating Environment handle (SQLAllocEnv)
> hEnv=3059112
> Allocating Connection handle (SQLAllocConnect)
> ...skipping forward
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]Invalid cursor state
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTableTypes(JdbcOdbcDatabaseMetaDat
> a.java:2505)
> at
> net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getTableTypes(SQLDat
> abaseMetaData.java:768)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander.<init>(DatabaseExpander.java:69)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeM
> odel.<init>(ObjectTreeModel.java:81)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> <init>(ObjectTree.java:119)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.CreateGUI(ObjectTreePanel.java:752)
> int
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.<init>(ObjectTreePanel.java:149)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.ObjectTreeTab.getCompo
> nent(ObjectTreeTab.java:84)
> ...skipping backward
> numeric() identity
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> decimal
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> money
> *Connection.getMetaData
> Fetching (SQLFetch), hStmt=3898184
> *DatabaseMetaData.getTableTypes
> *DatabaseMetaData.getTables (null,null,%,null)
> Allocating Statement Handle (SQLAllocStmt), hDbc=5012296
> hStmt=3912120
> Tables (SQLTables), hStmt=3912120,catalog=null, schema=null, table=%,
> types=nullGet string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> smallmoney
> Fetching (SQLFetch), hStmt=3898184
> RETCODE = -1
> ERROR - Generating SQLException...
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> decimal() identity
> Fetching (SQLFetch), hStmt=3898184
> SQLException: SQLState(24000) vendor code(0)
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]Invalid cursor state
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTableTypes(JdbcOdbcDatabaseMetaDat
> a.java:2505)
> at
> net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getTableTypes(SQLDat
> abaseMetaData.java:768)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander.<init>(DatabaseExpander.java:69)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeM
> odel.<init>(ObjectTreeModel.java:81)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> <init>(ObjectTree.java:119)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.CreateGUI(ObjectTreePanel.java:752)
> int
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.<init>(ObjectTreePanel.java:149)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.ObjectTreeTab.getCompo
> nent(ObjectTreeTab.java:84)
> Fetching (SQLFetch), hStmt=3898184
> at
> net.sourceforge.squirrel_sql.client.gui.session.MainPanel.addMainPanelTab(Ma
> inPanel.java:194)
> at
> net.sourceforge.squirrel_sql.client.gui.session.MainPanel.<init>(MainPanel.j
> ava:109)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.createGUI(Sessi
> onPanel.java:423)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.<init>(SessionP
> anel.java:101)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.createG
> UI(SessionInternalFrame.java:155)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.<init>(
> SessionInternalFrame.java:51)
> at
> net.sourceforge.squirrel_sql.client.gui.WindowManager.createInternalFrame(Wi
> ndowManager.java:375)
> at
> net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$R
> unner.run(ConnectToAliasCommand.java:446)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
> va:234)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
> :163)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> int identity
> Free statement (SQLFreeStmt), hStmt=3912120, fOption=1
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> smallint
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> smallint identity
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> float
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> real
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> datetime
> Fetching (SQLFetch), hStmt=3898184
> *Connection.getMetaData
> *DatabaseMetaData.supportsCatalogsInTableDefinitions
> Get connection info (SQLGetInfo), hDbc=5012296, fInfoType=92
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> int value=7
> smalldatetime
> Fetching (SQLFetch), hStmt=3898184
> Get string data (SQLGetData), hStmt=3898184, column=1, maxLen=129
> varchar
> Fetching (SQLFetch), hStmt=3898184
> End of result set (SQL_NO_DATA)
> *ResultSet.close
> Free statement (SQLFreeStmt), hStmt=3898184, fOption=1
> *ResultSet has been closed
> *DatabaseMetaData.getNumericFunctions
> Get connection info (SQLGetInfo), hDbc=5012296, fInfoType=49
> int value=8388607
> *DatabaseMetaData.getStringFunctions
> Get connection info (SQLGetInfo), hDbc=5012296, fInfoType=50
> int value=5242591
> *DatabaseMetaData.getTimeDateFunctions
> Get connection info (SQLGetInfo), hDbc=5012296, fInfoType=52
> int value=2097151
> *DatabaseMetaData.getCatalogs
> *DatabaseMetaData.getTables (%,,,null)
> Allocating Statement Handle (SQLAllocStmt), hDbc=5012296
> hStmt=3912120
> Tables (SQLTables), hStmt=3912120,catalog=%, schema=, table=, types=null
> RETCODE = -1
> ERROR - Generating SQLException...
> SQLException: SQLState() vendor code(15250)
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]The database name
> component of the object qualifier must be the name of the current database.
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getCatalogs(JdbcOdbcDatabaseMetaData.
> java:2471)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadCatalogs(SchemaIn
> fo.java:191)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:
> 125)
> at
> net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.ja
> va:632)
> at
> net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:
> 65)
> at
> net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> Free statement (SQLFreeStmt), hStmt=3912120, fOption=1
> *DatabaseMetaData.getSchemas
> *DatabaseMetaData.getTables (,%,,null)
> Allocating Statement Handle (SQLAllocStmt), hDbc=5012296
> hStmt=3912120
> Tables (SQLTables), hStmt=3912120,catalog=, schema=%, table=, types=null
> Number of result columns (SQLNumResultCols), hStmt=3912120
> value=5
> Fetching (SQLFetch), hStmt=3912120
> *ResultSet.getMetaData
> *ResultSetMetaData.getColumnName (1)
> Column attributes (SQLColAttributes), hStmt=3912120, icol=2, type=1
> value (String)=TABLE_OWNER
> java.sql.SQLException: Column not found
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1849)
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:410)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadSchemas(SchemaInf
> o.java:219)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:
> 136)
> at
> net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.ja
> va:632)
> at
> net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:
> 65)
> at
> net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> SQLException: SQLState(S0022)
> *ResultSet.close
> Free statement (SQLFreeStmt), hStmt=3912120, fOption=1
> *ResultSet has been closed
> -----------------------------------------
>
> and the squirrel-sql.log is similarly chatty:
> ---------------------------------------------
> 35439 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Keywords loaded
> 36913 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander - DBMS doesn't support 'getTableTypes()
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]Invalid cursor state
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTableTypes(JdbcOdbcDatabaseMetaDat
> a.java:2505)
> at
> net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getTableTypes(SQLDat
> abaseMetaData.java:768)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander.<init>(DatabaseExpander.java:69)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeM
> odel.<init>(ObjectTreeModel.java:81)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> <init>(ObjectTree.java:119)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.CreateGUI(ObjectTreePanel.java:752)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.<init>(ObjectTreePanel.java:149)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.ObjectTreeTab.getCompo
> nent(ObjectTreeTab.java:84)
> at
> net.sourceforge.squirrel_sql.client.gui.session.MainPanel.addMainPanelTab(Ma
> inPanel.java:194)
> at
> net.sourceforge.squirrel_sql.client.gui.session.MainPanel.<init>(MainPanel.j
> ava:109)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.createGUI(Sessi
> onPanel.java:423)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.<init>(SessionP
> anel.java:101)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.createG
> UI(SessionInternalFrame.java:155)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionInternalFrame.<init>(
> SessionInternalFrame.java:51)
> at
> net.sourceforge.squirrel_sql.client.gui.WindowManager.createInternalFrame(Wi
> ndowManager.java:375)
> at
> net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$R
> unner.run(ConnectToAliasCommand.java:446)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
> va:234)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
> :163)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
> 37339 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Loading functions
> 37405 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Functions loaded
> 37406 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Loading functions
> 37494 [Thread-4] ERROR
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - failed to load
> catalog names
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]The database name
> component of the object qualifier must be the name of the current database.
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getCatalogs(JdbcOdbcDatabaseMetaData.
> java:2471)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadCatalogs(SchemaIn
> fo.java:191)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:
> 125)
> at
> net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.ja
> va:632)
> at
> net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:
> 65)
> at
> net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> 37497 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Functions loaded
> 37508 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Loading functions
> 37622 [Thread-4] ERROR
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - failed to load
> schema names
> java.sql.SQLException: Column not found
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1849)
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:410)at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadSchemas(SchemaInf
> o.java:219)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:
> 136)
> at
> net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.ja
> va:632)
> at
> net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:
> 65)
> at
> net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> 37627 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Functions loaded
> 37628 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Loading tables
> 38140 [Thread-4] ERROR
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - failed to load
> table names
> java.sql.SQLException: Column not found
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.findColumn(JdbcOdbcResultSet.java:1849)
> at
> sun.jdbc.odbc.JdbcOdbcResultSet.getString(JdbcOdbcResultSet.java:410)at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadTables(SchemaInfo
> .java:761)
> at
> net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:
> 148)
> at
> net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.ja
> va:632)
> at
> net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:
> 65)
> at
> net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> 38144 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Tables loaded
> 38146 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - Loading stored
> procedures
> 38254 [Thread-4] DEBUG
> net.sourceforge.squirrel_sql.client.session.SchemaInfo - stored procedures
> loaded
> 38255 [Thread-4] DEBUG net.sourceforge.squirrel_sql.fw.util.TaskThreadPool
> - Returning thread. 2 threads available
> 40864 [AWT-EventQueue-0] ERROR
> net.sourceforge.squirrel_sql.fw.util.StringManager - No resource string
> found for key 'SessionTextEditPopupMenu.makeeditable'
> 40895 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.fw.util.Resources - No resource found for
> action.net.sourceforge.squirrel_sql.client.session.action.UndoAction : image
> 40900 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.fw.util.Resources - No resource found for
> action.net.sourceforge.squirrel_sql.client.session.action.RedoAction : image
> 41318 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.fw.util.Resources - No resource found for
> action.net.sourceforge.squirrel_sql.client.gui.session.ToolsPopupAction :
> image
> 42270 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.client.session.mainpanel.BaseMainPanelTab -
> Refreshing SQL main tab.
> 42484 [AWT-EventQueue-0] DEBUG
> net.sourceforge.squirrel_sql.fw.util.TaskThreadPool - Reusing existing
> thread
> 42501 [Thread-3] DEBUG net.sourceforge.squirrel_sql.fw.util.TaskThreadPool
> - Using a thread. 1 threads available
> 42602 [AWT-EventQueue-0] ERROR
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel - Unable to
> retrieve catalog info
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]The database name
> component of the object qualifier must be the name of the current database.
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getCatalogs(JdbcOdbcDatabaseMetaData.
> java:2471)
> at
> net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getCatalogs(SQLDatab
> aseMetaData.java:468)
> at
> net.sourceforge.squirrel_sql.fw.gui.SQLCatalogsComboBox.setConnection(SQLCat
> alogsComboBox.java:69)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel$MyToolBar.setup
> CatalogsCombo(SessionPanel.java:534)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel$MyToolBar.acces
> s$300(SessionPanel.java:445)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel$3.objectTreeRef
> reshed(SessionPanel.java:467)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> fireObjectTreeRefreshed(ObjectTree.java:658)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> refresh(ObjectTree.java:255)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTreeP
> anel.refreshTree(ObjectTreePanel.java:570)
> at
> net.sourceforge.squirrel_sql.client.gui.session.SessionPanel.addNotify(Sessi
> onPanel.java:137)
> at java.awt.Container.addNotify(Container.java:2500)
> at javax.swing.JComponent.addNotify(JComponent.java:4436)
> at java.awt.Container.addNotify(Container.java:2500)
> at javax.swing.JComponent.addNotify(JComponent.java:4436)
> at javax.swing.JRootPane.addNotify(JRootPane.java:680)
> at java.awt.Container.addNotify(Container.java:2500)
> at javax.swing.JComponent.addNotify(JComponent.java:4436)
> at java.awt.Container.addImpl(Container.java:1052)
> at javax.swing.JLayeredPane.addImpl(JLayeredPane.java:204)
> at
> net.sourceforge.squirrel_sql.client.gui.ScrollableDesktopPane.addImpl(Scroll
> ableDesktopPane.java:66)
> at java.awt.Container.add(Container.java:351)
> at
> net.sourceforge.squirrel_sql.client.gui.mainframe.MainFrame.addInternalFrame
> (MainFrame.java:197)
> at
> net.sourceforge.squirrel_sql.client.gui.WindowManager.createInternalFrame(Wi
> ndowManager.java:379)
> at
> net.sourceforge.squirrel_sql.client.mainframe.action.ConnectToAliasCommand$R
> unner.run(ConnectToAliasCommand.java:446)
> at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
> at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
> at
> java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.ja
> va:234)
> at
> java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java
> :163)
> at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)at
> java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
> 42907 [Thread-3] ERROR
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree
> - Error: Macola1_Free_ODBC
> java.sql.SQLException: [unixODBC][FreeTDS][SQL Server]The database name
> component of the object qualifier must be the name of the current database.
> at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6958)
> at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7115)
> at sun.jdbc.odbc.JdbcOdbc.SQLTables(JdbcOdbc.java:5519)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getTables(JdbcOdbcDatabaseMetaData.ja
> va:2395)
> at
> sun.jdbc.odbc.JdbcOdbcDatabaseMetaData.getCatalogs(JdbcOdbcDatabaseMetaData.
> java:2471)
> at
> net.sourceforge.squirrel_sql.fw.sql.SQLDatabaseMetaData.getCatalogs(SQLDatab
> aseMetaData.java:468)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander.createCatalogNodes(DatabaseExpander.java:173)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.expanders.D
> atabaseExpander.createChildren(DatabaseExpander.java:125)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree$
> TreeLoader.loadChildren(ObjectTree.java:815)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree$
> TreeLoader.execute(ObjectTree.java:766)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> expandNode(ObjectTree.java:398)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree.
> access$600(ObjectTree.java:65)
> at
> net.sourceforge.squirrel_sql.client.session.mainpanel.objecttree.ObjectTree$
> ExpansionController.run(ObjectTree.java:717)
> at
> net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
> at java.lang.Thread.run(Thread.java:595)
> 42940 [Thread-3] DEBUG net.sourceforge.squirrel_sql.fw.util.TaskThreadPool
> - Returning thread. 2 threads available
> ----------------------------------------
>
> I traced through the same connect, and this is what the trace log looks like
> doing this:
> ---------------------------------------
> [ODBC][16664][SQLTables.c][196]
> Entry:
> Statement = 178438
> Catalog Name = [NULL]
> Schema Name = [NULL]
> Table Name = [%][length = 1 (SQL_NTS)]
> Table Type = [NULL]
> [ODBC][16664][SQLGetData.c][447]
> Exit:[SQL_SUCCESS]
> Buffer = [image]
> Strlen Or Ind = f71012b4 -> 5
> [ODBC][16664][SQLTables.c][408]
> Exit:[SQL_ERROR]
> [ODBC][16664][SQLFetch.c][158]
> Entry:
> Statement = 177e60
> DIAG [24000] [FreeTDS][SQL Server]Invalid cursor state
>
> [ODBC][16664][SQLFetch.c][340]
> Exit:[SQL_SUCCESS]
> [ODBC][16664][SQLError.c][342]
> Entry:
> Statement = 178438
> SQLState = 4c0150
> Native = f6e00638
> Message Text = 4de6b0
> Buffer Length = 300
> Text Len Ptr = f6e0063e
> [ODBC][16664][SQLGetData.c][219]
> Entry:
> Statement = 177e60
> Column Number = 1
> Target Type = 1 SQL_CHAR
> Buffer Length = 129
> Target Value = 4de7e8
> StrLen Or Ind = f71012b4
> [ODBC][16664][SQLError.c][379]
> Exit:[SQL_SUCCESS]
> SQLState = 24000
> Native = f6e00638 -> 0
> Message Text = [[unixODBC][FreeTDS][SQL
> Server]Invalid cursor state]
> [ODBC][16664][SQLGetData.c][447]
> Exit:[SQL_SUCCESS]
> Buffer = [varbinary]
> Strlen Or Ind = f71012b4 -> 9
> [ODBC][16664][SQLFetch.c][158]
> Entry:
> Statement = 177e60
> [ODBC][16664][SQLFetch.c][340]
> Exit:[SQL_SUCCESS]
> [ODBC][16664][SQLGetData.c][219]
> Entry:
> Statement = 177e60
> Column Number = 1
> Target Type = 1 SQL_CHAR
> Buffer Length = 129
> Target Value = 4de640
> StrLen Or Ind = f71012b4
> [ODBC][16664][SQLGetData.c][447]
> Exit:[SQL_SUCCESS]
> Buffer = [binary]
> Strlen Or Ind = f71012b4 -> 6
> [ODBC][16664][SQLFetch.c][158]
> Entry:
> Statement = 177e60
> [ODBC][16664][SQLFetch.c][340]
> Exit:[SQL_SUCCESS]
> --------------------------------------------------------------
>
> I don't see any clues in there. Can you make more of this that I can?
>
> Thanks,
>
> David
>

Well... it seems a collection of problem. First, mssql do not support
multiple active statement on same connection so SQLTables seems to fail.
This is not mandatory, two connections should be used (still we do not
fully support cursors however problem still remain even if full cursors
support would be implemented cause caller have to enable cursors
explicitly). Another problem is that sp_tables (used internally by our
driver) should be called from requested catalog... I'll try this...

freddy77






Archive powered by MHonArc 2.6.24.

Top of Page