jTDS jdbc driver with sybase 12.5 problem

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

jTDS jdbc driver with sybase 12.5 problem

Gupta, Abhishek

Hello,

 

I am getting this exception when I try to use the object browser to view the contents or row count.

The driver version is 1.1 and database version is 12.5.3. Squirrel is compiled from latest cvs sources.

 

java.sql.SQLException: "futmatch_dev8"."dbo"."DBColumnList" not found. Specify owner.objectname or use sp_help to check whether the object exists (sp_help may produce lots of output).

 

The name of the table should be futmatch_dev8.dbo.DBColumnList i.e. without quotes.

 

The reason seems to be this piece of code in class SQLDatabaseMetaData.

 

            public synchronized String getIdentifierQuoteString() throws SQLException

            {

                        final String key = "getIdentifierQuoteString";

                        String value = (String)_cache.get(key);

                        if (value == null)

                        {

                                    final String driverName = getDriverName();

                                    if (driverName.equals(IDriverNames.FREE_TDS)

                                                || driverName.equals(IDriverNames.JCONNECT))

                                    {

                                                value = "";

                                    }

                                    else

                                    {

                                                value = privateGetJDBCMetaData().getIdentifierQuoteString();

                                    }

                                    _cache.put(key, value);

                        }

                        return value;

            }

 

To fix this I added a new driver name in IDriverNames

 

            private interface IDriverNames

            {

                        String FREE_TDS = "InternetCDS Type 4 JDBC driver for MS SQLServer";

                        String JCONNECT = "jConnect (TM) for JDBC (TM)";

                        String OPTA2000 = "i-net OPTA 2000";

                        String JTDS = "jTDS Type 4 JDBC Driver for MS SQL Server and Sybase";

            }

 

And changed the above method to

 

            public synchronized String getIdentifierQuoteString() throws SQLException

            {

                        final String key = "getIdentifierQuoteString";

                        String value = (String)_cache.get(key);

                        if (value == null)

                        {

                                    final String driverName = getDriverName();

                                    if (driverName.equals(IDriverNames.FREE_TDS)

                                                || driverName.equals(IDriverNames.JCONNECT)

                                                || driverName.equals(IDriverNames.JTDS))

                                    {

                                                value = "";

                                    }

                                    else

                                    {

                                                value = privateGetJDBCMetaData().getIdentifierQuoteString();

                                    }

                                    _cache.put(key, value);

                        }

                        return value;

            }

 

If this is the correct solution for this problem, please integrate this in squirrel.

Otherwise let me know if there is another way to fix this.

 

Thanks

Abhishek

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: jTDS jdbc driver with sybase 12.5 problem

Gerd Wagner
Hi Abhishek,

your patch is in CVS.

Thanks a lot.

Gerd

Gupta, Abhishek wrote:

> Hello,
>
>  
>
> I am getting this exception when I try to use the object browser to view
> the contents or row count.
>
> The driver version is 1.1 and database version is 12.5.3. Squirrel is
> compiled from latest cvs sources.
>
>  
>
> java.sql.SQLException: "futmatch_dev8"."dbo"."DBColumnList" not found.
> Specify owner.objectname or use sp_help to check whether the object
> exists (sp_help may produce lots of output).
>
>  
>
> The name of the table should be futmatch_dev8.dbo.DBColumnList i.e.
> without quotes.
>
>  
>
> The reason seems to be this piece of code in class SQLDatabaseMetaData.
>
>  
>
>             public synchronized String getIdentifierQuoteString() throws
> SQLException
>
>             {
>
>                         final String key = "getIdentifierQuoteString";
>
>                         String value = (String)_cache.get(key);
>
>                         if (value == null)
>
>                         {
>
>                                     final String driverName =
> getDriverName();
>
>                                     if
> (driverName.equals(IDriverNames.FREE_TDS)
>
>                                                 ||
> driverName.equals(IDriverNames.JCONNECT))
>
>                                     {
>
>                                                 value = "";
>
>                                     }
>
>                                     else
>
>                                     {
>
>                                                 value =
> privateGetJDBCMetaData().getIdentifierQuoteString();
>
>                                     }
>
>                                     _cache.put(key, value);
>
>                         }
>
>                         return value;
>
>             }
>
>  
>
> To fix this I added a new driver name in IDriverNames
>
>  
>
>             private interface IDriverNames
>
>             {
>
>                         String FREE_TDS = "InternetCDS Type 4 JDBC
> driver for MS SQLServer";
>
>                         String JCONNECT = "jConnect (TM) for JDBC (TM)";
>
>                         String OPTA2000 = "i-net OPTA 2000";
>
>                         String JTDS = "jTDS Type 4 JDBC Driver for MS
> SQL Server and Sybase";
>
>             }
>
>  
>
> And changed the above method to
>
>  
>
>             public synchronized String getIdentifierQuoteString() throws
> SQLException
>
>             {
>
>                         final String key = "getIdentifierQuoteString";
>
>                         String value = (String)_cache.get(key);
>
>                         if (value == null)
>
>                         {
>
>                                     final String driverName =
> getDriverName();
>
>                                     if
> (driverName.equals(IDriverNames.FREE_TDS)
>
>                                                 ||
> driverName.equals(IDriverNames.JCONNECT)
>
>                                                 ||
> driverName.equals(IDriverNames.JTDS))
>
>                                     {
>
>                                                 value = "";
>
>                                     }
>
>                                     else
>
>                                     {
>
>                                                 value =
> privateGetJDBCMetaData().getIdentifierQuoteString();
>
>                                     }
>
>                                     _cache.put(key, value);
>
>                         }
>
>                         return value;
>
>             }
>
>  
>
> If this is the correct solution for this problem, please integrate this
> in squirrel.
>
> Otherwise let me know if there is another way to fix this.
>
>  
>
> Thanks
>
> Abhishek
>



-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
Squirrel-sql-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/squirrel-sql-users
Loading...