Connecting to a server using JNDI  Required directory service information

Chapter 2: Programming Information

Connection URL for using JNDI

To specify that jConnect use JNDI to obtain connection information, place “jndi” as the URL’s subprotocol after “sybase”:

jdbc:sybase:jndi:protocol-information-for-use-with-JNDI

Anything that follows “jndi” in the URL is handled through JNDI. For example, to use JNDI with the Lightweight Directory Access Protocol (LDAP), you might enter:

jdbc:sybase:jndi:ldap://LDAP_hostname:port_number/servername=
  Sybase11,o=MyCompany,c=US

This URL tells JNDI to obtain information from an LDAP server, gives the host name and port number of the LDAP server to use, and provides the name of a database server in an LDAP-specific form.





Copyright © 2003. Sybase Inc. All rights reserved. Required directory service information

View this book as PDF