[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
JDBC-LDAP Bridge V2 - Base64 encoding
- To: "OpenLDAP-Software" <openldap-software@OpenLDAP.org>
- Subject: JDBC-LDAP Bridge V2 - Base64 encoding
- From: "Theodore Villette" <tvillette@hotmail.com>
- Date: Tue, 26 Apr 2005 10:07:28 +0200
- References: <20041130141227.E2FA.ZHANG@fjh.fujitsu.com> <20041130152050.E300.ZHANG@fjh.fujitsu.com> <BAY102-DAV7537D2DE1EB6CDFD07EC9A4A80@phx.gbl>
Hello,
I am using JDBC-LDAP Bridge v2 and i have a problem with base64 encoding.
In fact, i saw in the source code that sometimes, attributes are encoded,
sometimes not:
In com.octetstring.jdbcLdap.jndi.UnpackResults:
protected LDAPEntry extractEntry (...
byte[] bval = attrib.getByteValue();
if (bval == null) {
bval = new byte[0];
}
if (Base64.isLDIFSafe(bval)) {
svals = attrib.getStringValueArray();
} else {
byteVals = attrib.getByteValueArray();
svals = new String[byteVals.length];
for (int i=0,m=byteVals.length;i<m;i++) {
svals[i] = com.novell.ldap.util.Base64.encode(byteVals[i]);
}
}
It is OK for binary fields but the problem appears when i want to get value
of strings, i do not know if i have to decode it. Indeed, some strings are
not "ldifsafe" (like "Theodore") whereas others are (like "Villette").
I think the driver should decode values when there are encoded (in
com.octetstring.jdbcLdap.sql.LdapResultSet for example) before returning it.
Theodore Villette