Issue 3541 - ResultSet getString(int i)
Summary: ResultSet getString(int i)
Status: UNCONFIRMED
Alias: None
Product: JLDAP
Classification: Unclassified
Component: JDBC (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-15 19:07 UTC by robinsoncharles@comcast.net
Modified: 2020-03-18 19:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description robinsoncharles@comcast.net 2005-02-15 19:07:39 UTC
Full_Name: Charles Robinson
Version: doc says 0.1 zip suggests 2.0
OS: Wiin 2000
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (130.36.62.127)


When analyzing the ResultSet derived from a Select as follows (notice the
explicit names in the select)

ResultSet rs = stmt.executeQuery("SELECT
cn,displayName,givenName,department,mail FROM ou=Users where
sn="+lastnames[i]);

I found that if I did a rs.getString(1) I got a random column.
I converted to rs.getString("cn") and got the column named.

It looked as if the result set was ordered by whatever order LDAP itself turned
back, not what the programmer specified in the select.


 

Comment 1 ando@openldap.org 2005-02-19 10:31:26 UTC
robinsoncharles@comcast.net wrote:

>Full_Name: Charles Robinson
>Version: doc says 0.1 zip suggests 2.0
>OS: Wiin 2000
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (130.36.62.127)
>
>
>When analyzing the ResultSet derived from a Select as follows (notice the
>explicit names in the select)
>
>ResultSet rs = stmt.executeQuery("SELECT
>cn,displayName,givenName,department,mail FROM ou=Users where
>sn="+lastnames[i]);
>
>I found that if I did a rs.getString(1) I got a random column.
>I converted to rs.getString("cn") and got the column named.
>
>It looked as if the result set was ordered by whatever order LDAP itself turned
>back, not what the programmer specified in the select.
>  
>
It is unclear what client software is being used; it seems o be unrelated to OpenLDAP software.  In any case, OpenLDAP's slapd returns the attributes in an implementation dependent order that may be totally unrelated to the order they are requested; there is no indication in the specs as per what order attributes must be returned.

p.






    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497

Comment 2 ando@openldap.org 2005-02-19 10:31:38 UTC
changed notes
changed state Open to Suspended
Comment 3 robinsoncharles@comcast.net 2005-02-19 17:13:53 UTC
Your answer certainly agrees with my observations.

However, I was under the impression that the SQL standard did specify
the order of return when the programmer specified explicit columns in
the select statement (did not use something like the * notation).

As least this is the way I have seen every SQL vendor I ever dealt with
before (Oracle, Informix, Sybase). Anc certainly the order of results
did not change between rows of the result set :-(

IMHO, this is probably not an openLDAP slapd issue, rather it is a
surprising feature of the JDBC-LDAP Bridge Driver (JDBC-LDAP) by
OctetString




I've stopped 3,102 spam messages. You can too!
One month FREE spam protection at http://www.cloudmark.com/spamnetsig/}
-----Original Message-----
From: Pierangelo Masarati [mailto:ando@sys-net.it] 
Sent: Saturday, February 19, 2005 4:31 AM
To: robinsoncharles@comcast.net
Cc: openldap-its@OpenLDAP.org
Subject: Re: (ITS#3541) ResultSet getString(int i)

robinsoncharles@comcast.net wrote:

>Full_Name: Charles Robinson
>Version: doc says 0.1 zip suggests 2.0
>OS: Wiin 2000
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (130.36.62.127)
>
>
>When analyzing the ResultSet derived from a Select as follows (notice
the
>explicit names in the select)
>
>ResultSet rs = stmt.executeQuery("SELECT
>cn,displayName,givenName,department,mail FROM ou=Users where
>sn="+lastnames[i]);
>
>I found that if I did a rs.getString(1) I got a random column.
>I converted to rs.getString("cn") and got the column named.
>
>It looked as if the result set was ordered by whatever order LDAP
itself turned
>back, not what the programmer specified in the select.
>  
>
It is unclear what client software is being used; it seems o be
unrelated to OpenLDAP software.  In any case, OpenLDAP's slapd returns
the attributes in an implementation dependent order that may be totally
unrelated to the order they are requested; there is no indication in the
specs as per what order attributes must be returned.

p.






    SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax:
+390382476497

Comment 4 Kurt Zeilenga 2005-03-15 04:00:30 UTC
changed notes
Comment 5 Kurt Zeilenga 2005-03-19 19:49:42 UTC
moved from Incoming to Contrib
Comment 6 mboorshtein@openldap.org 2005-06-15 00:54:14 UTC
This SHOULD allow you to get attrbutes via number the way you request
them as this is part of the JDBC spec.  I'll make this a feature
request.

Marc

Comment 7 mboorshtein@openldap.org 2005-06-21 02:39:01 UTC
changed state Suspended to Open
Comment 8 OpenLDAP project 2014-08-01 21:03:26 UTC
jdbc-ldap