📄 e481. creating an initial context to a directory.txt
字号:
This example uses the JNDI/LDAP service provider to connect to an LDAP server on the local machine.
String url = "ldap://localhost/o=JNDITutorial";
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
try {
DirContext ctx = new InitialDirContext(env);
} catch (NamingException e) {
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -