🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.java.databases
Article #38

Re: JDBC-ODBC + SQL Server 6.5 + ResultSet + getString/getInt = SQLException

#38
From: Michael Chen
Date: Mon, 31 Aug 1998 00:00
51 lines
2620 bytes
This is caused by a limitation on the SQL Server ODBC Driver and the way
JDBC-ODBC bridge was designed.  The detail is not that simple to explain.

This combination demands that you call getXXX() in the same order of the
select list of your query.  For example, if your query is:

  "select settlement, amount, description from case_database"

Then you must not call getXXX() on amount and description before you
have done it for settlement.

If you use IDS Server, you don't have to worry about this, because its
IDS JDBC Driver uses a different and more efficient mechanism.

Thank you

Michael Chen
IDS Software -- Home of IDS Server
The best Type-3 JDBC driver solution.
http://www.idssoftware.com/
----------


Jason R. Mihalick wrote in message <6s1ujp$g7g@enews1.newsguy.com>...
>Hello,
>
>I'm using JDK 1.1.6 (with JBuilder 2), the JDBC-ODBC bridge, and SQL Server
>6.5 and have been experiencing some odd behavior from the
>ResultSet.getString(String) and ResultSet.getInt(String) methods.  The order
>in which I execute the getXXX methods seems to matter for some reason.
>
>For instance, I have a column named "settlement", which is a varchar field.
>If I don't call rs.getString("settlement") before I call any of the other
>getXXX methods, an SQLException is thrown that says: "[Microsoft][ODBC SQL
>Server Driver]Invalid column number"  If I put the getXXX calls in a certain
>order (and I haven't figured out the pattern yet), then life is good, no
>Exceptions thrown.
>
>I've found that this happens with the ResultSet.getInt(String) method as
>well.  It's like there is some kind of problem with the hash tables that the
>getXXX methods are using.  On the other hand, it could be some dumb mistake
>that I'm making!
>
>Anybody ever see this kind of behavior?
>
>Thanks in advance,
>
>Jason
>
>
>
Technical Details
Message-ID: <6sg063$je1$1@birch.prod.itd.earthlink.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6s1ujp$g7g@enews1.newsguy.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 107d46,91df2c8488888997
X-Google-Attributes: gid107d46,public
X-Google-Thread: 1073da,91df2c8488888997
X-Google-Attributes: gid1073da,public
From: "Michael Chen" <michaelc@idssoftware.com>
Subject: Re: JDBC-ODBC + SQL Server 6.5 + ResultSet + getString/getInt = SQLException
Date: 1998/08/31
Message-ID: <6sg063$je1$1@birch.prod.itd.earthlink.net>
X-Deja-AN: 386689394
References: <6s1ujp$g7g@enews1.newsguy.com>
X-Posted-Path-Was: not-for-mail
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
X-ELN-Date: Mon Aug 31 22:20:03 1998
Organization: IDS Software
Reply-To: "Michael Chen" <info@idssoftware.com>
Newsgroups: comp.lang.java.databases,borland.public.jbuilder.database