The Java 2 SE v.1.3 says this of the ResultSet interface:

"For maximum portability, result set columns within each row should be read
in left-to-right order, and each column should be read only once."

This would indicate some drivers (in this case, JDBC-ODBC) do not support
bi-directional column navigation.

What would be the workaround for this?  I saw copying result values into an
array for further processing, but this is an unhappy extra step.  Would a
third party driver for SQL Server impose the same restrictions?


-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Flemming Seerup
Sent: Tuesday, August 15, 2000 1:50 AM
To: [EMAIL PROTECTED]
Subject: Re: JDBC - access order of fields


hi Neal

The "feature" you experience is in fact a well known bug in Suns JDBC-ODBC
bridge. You HAVE to access fields in the order you specify them in your
select statement!
If possible I would recommand that you switch to a native JDBC driver for
your specific database. (This way you will also gain the features in a JDCB
2.0 driver)

/Flemming

----- Original Message -----
From: "Neal Cabage" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 15, 2000 7:24 AM
Subject: JDBC - access order of fields


> When acessing information from my SQLserver DB using JDBC, I noticed that
I
> must access the fields sequentially as they're defined in the DB.  This is
> very odd to me.
>
> For instance, if the fields are sequentially defined as ID, NAME, and DATE
> when defining the DB, then later when I attempt to access the dB I must
> access that data in that order. If I first access Date and *then* attempt
to
> access NAME for instance, I will get an error.
>
> Provided the code below - can anyone tell me what I need to do to allow
> dynamic column surfing?  This reminds me of a behavior that one would
affect
> when setting a cursor type in dealing with rows ... surely there must be a
> similar something for columns (?).
>
> Thanks.
> Neal
>
>
>
>  Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
file://DB DRIVER
>
>  String pUri            = "jdbc:odbc:ICXX_LA";
file://DSN DEFINITION
>  String pUid            = "XX";
file://UID
>  String pPwd            = "XX";
file://PWD
>  String pSql            = "select * from tbl_qa_errors";
file://SQL
>
>  Connection cn          = DriverManager.getConnection(pUri,pUid,pPwd);
> file://Connection obj
>  Statement  st          = cn.createStatement();
file://Statement Obj
>  ResultSet  rs                  = st.executeQuery(pSql);
file://RecordSet Obj
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to