文档

Java™ 教程-Java Tutorials 中文版
搜索
Trail: Java Naming and Directory Interface
Lesson: Naming and Directory Operations

搜索

One of the most useful features that a directory offers is its yellow pages, or search, service. You can compose a query consisting of attributes of entries that you are seeking and submit that query to the directory. The directory then returns a list of entries that satisfy the query. For example, you could ask the directory for all entries with a bowling average greater than 200 or all entries that represent a person with a surname beginning with "Sch."

The DirContext interface provides several methods for searching the directory, with progressive degrees of complexity and power. The various aspects of searching the directory are covered in the following sections:


Previous page: Add, Replace Bindings with Attributes
Next page: Basic Search