Class Driver
- java.lang.Object
-
- com.filenet.api.jdbc.Driver
-
- All Implemented Interfaces:
- java.sql.Driver
public class Driver extends java.lang.Object implements java.sql.DriverRegisters a Java™ Database Connectivity (JDBC) driver and establishes a connection with a Content Engine database, providing metadata information on object stores and executing queries against those object stores. Instances of this class can connect to a Content Engine database server using either the Enterprise Java™Beans (EJB) Listener or the Web Services Listener, depending on the transport configured. The database referenced is a logical view, reflecting the Content Engine data model as a merged scope (seeSearchScope); it is not a direct connection to a Content Engine database.Getting an instance of this class registers the driver. The
EngineRuntimeException JDBC_DRIVER_STATIC_ERRORis thrown if the driver registration fails.Establish a JDBC connection using the
connectmethod. The following values are required, either as part of the connection string or thePropertiescollection parameter:- User credentials, specified using the
USER_PROPERTY_KEYandPASSWORD_PROPERTY_KEYfields. The JDBC user is expected to be a security principal defined within an accessible LDAP directory service. Authentication is performed within the driver using the Java™ Authentication and Authorization Service (JAAS) API, with the specified user credentials passed to generate the JAAS Subject. - The URI of the target Content Engine database for the JDBC connection, specified by the
URI_PROPERTY_KEYfield. The URI is specified as part of theurlparameter passed to theconnectmethod. For example:jdbc:filenetp8:http://ceserver:7001/wsi/FNCEWS40MTOM/
- The object store name or names, specified by the
OBJECTSTORES_PROPERTY_KEYfield The object stores are specified as part of theurlparameter passed to theconnectmethod. Multiple object store names are separated by "|" (vertical line character). For example:objectstores=FileNet1|FileNet2|FileNet3
Either the object store's symbolic name or display name can be used, although the name cannot include the "|" delimiter (this is possible only for display names).
The following values are optional when establishing the JDBC connection:
- The merge mode value, specified by the
MERGEMODE_PROPERTY_KEYfield. This value is used when multiple object stores are specified for the connection, and determines whether the scope is the union or intersection of the object stores. Allowed values are "union" and "intersection", case-insensitive (defaults to "union"). - The JAAS configuration entry, specified by the
JAASCONFIGNAME_PROPERTY_KEYfield. Any one of the following conditions can supply the JAAS context: an established JAAS login context is used, the default JAAS context name ("FileNetP8", case-sensitive) is used, or the value ofJAASCONFIGNAME_PROPERTY_KEYis used.To indicate the established JAAS login context is to be used, specify "!" (exclamation character) as this value. In this case, the user and password field values are ignored. All other field values are used as specified.
If no value is specified, the default provided by
UserContext.createSubjectis used. - The locale, specified by the
LOCALE_PROPERTY_KEYfield. If unspecified, the default Java™ Runtime Environment (JRE) locale is used.
- See Also:
MergeMode
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringJAASCONFIGNAME_PROPERTY_KEYThe key for the JAAS configuration name used in the Properties instance passed to the driver.static java.lang.StringLOCALE_PROPERTY_KEYThe key for the locale value specified in the database URL, or used in thePropertiesinstance passed to the driver.static java.lang.StringMERGEMODE_PROPERTY_KEYThe key for the merge mode value specified in the database URL, or used in thePropertiesinstance passed to the driver.static java.lang.StringOBJECTSTORES_PROPERTY_KEYThe key for the object stores value specified in the database URL, or used in thePropertiesinstance passed to the driver.static java.lang.StringPASSWORD_PROPERTY_KEYThe key for the password value specified in the database URL, or used in thePropertiesinstance passed to the driver.static java.lang.StringURI_PROPERTY_KEYThe key for the URI value specified in the database URL, or used in thePropertiesinstance passed to the driver.static java.lang.StringUSER_PROPERTY_KEYThe key for the username value specified in the database URL, or used in thePropertiesinstance passed to the driver.
-
Constructor Summary
Constructors Constructor and Description Driver()Registers the JDBC driver.
-
Method Summary
Methods Modifier and Type Method and Description booleanacceptsURL(java.lang.String url)Indicates whether the driver should be able to open a connection to the specified URL.java.sql.Connectionconnect(java.lang.String url, java.util.Properties info)Attempts to establish a JDBC connection to the database identified by the specified URL.booleanequals(java.lang.Object obj)Indicates whether the object specified references this instance.intgetMajorVersion()Gets the major version number for the driver.intgetMinorVersion()Get the minor version number for the driver.java.sql.DriverPropertyInfo[]getPropertyInfo(java.lang.String url, java.util.Properties info)Enables a generic UI tool to discover the properties needed to include in prompts for information sufficient to connect to a database.inthashCode()booleanjdbcCompliant()Indicates whether the driver is JDBC-compliant.
-
-
-
Field Detail
-
URI_PROPERTY_KEY
public static final java.lang.String URI_PROPERTY_KEY
The key for the URI value specified in the database URL, or used in thePropertiesinstance passed to the driver. This is a required field.- See Also:
- Constant Field Values
-
OBJECTSTORES_PROPERTY_KEY
public static final java.lang.String OBJECTSTORES_PROPERTY_KEY
The key for the object stores value specified in the database URL, or used in thePropertiesinstance passed to the driver. This is a required field.- See Also:
- Constant Field Values
-
MERGEMODE_PROPERTY_KEY
public static final java.lang.String MERGEMODE_PROPERTY_KEY
The key for the merge mode value specified in the database URL, or used in thePropertiesinstance passed to the driver. This value is used when multiple object stores are specified for the connection, and determines whether the scope is the union or intersection of the object stores. If unspecified, this defaults to "union".- See Also:
- Constant Field Values
-
PASSWORD_PROPERTY_KEY
public static final java.lang.String PASSWORD_PROPERTY_KEY
The key for the password value specified in the database URL, or used in thePropertiesinstance passed to the driver. This is a required field unless the existing JAAS login context is to be used (the value of JAASCONFIGNAME_PROPERTY_KEY is "!").- See Also:
- Constant Field Values
-
USER_PROPERTY_KEY
public static final java.lang.String USER_PROPERTY_KEY
The key for the username value specified in the database URL, or used in thePropertiesinstance passed to the driver. This is a required field unless the existing JAAS login context is to be used (the value of JAASCONFIGNAME_PROPERTY_KEY is "!").- See Also:
- Constant Field Values
-
LOCALE_PROPERTY_KEY
public static final java.lang.String LOCALE_PROPERTY_KEY
The key for the locale value specified in the database URL, or used in thePropertiesinstance passed to the driver. If unspecified, the default JRE locale is used.- See Also:
- Constant Field Values
-
JAASCONFIGNAME_PROPERTY_KEY
public static final java.lang.String JAASCONFIGNAME_PROPERTY_KEY
The key for the JAAS configuration name used in the Properties instance passed to the driver. To indicate the existing, established JAAS login context is to be used, specify "!" (exclamation character) as this value. If unspecified, this defaults to "FileNetP8" (case-sensitive).- See Also:
- Constant Field Values
-
-
Method Detail
-
acceptsURL
public boolean acceptsURL(java.lang.String url) throws java.sql.SQLExceptionIndicates whether the driver should be able to open a connection to the specified URL.- Specified by:
acceptsURLin interfacejava.sql.Driver- Parameters:
url- AStringcontaining the URL of the database to connect to. The following is an example of the URL format required (line break for readability):jdbc:filenetp8:http://ceserver:7001/wsi/FNCEWS40MTOM/?objectstores=FileNet1|FileNet2 &mergemode=intersection&jaasconfigname=Jazz- Returns:
- A
booleanvalue of true if the driver can be expected to establish a connection to the URL; false otherwise. - Throws:
java.sql.SQLException
-
connect
public java.sql.Connection connect(java.lang.String url, java.util.Properties info) throws java.sql.SQLExceptionAttempts to establish a JDBC connection to the database identified by the specified URL.Nullis returned if an invalid driver is used for the specified URL. When multiple drivers are loaded, a null return value can occur as theDriverManagerpasses connection requests to each of the drivers in sequence.- Specified by:
connectin interfacejava.sql.Driver- Parameters:
url- AStringcontaining the URL of the database to connect to. The following is an example of the URL format required (line break for readability):jdbc:filenetp8:http://ceserver:7001/wsi/FNCEWS40MTOM/?objectstores=FileNet1|FileNet2 &mergemode=intersection&jaasconfigname=Jazzinfo- APropertiescollection of the field and value pairs as connection arguments. For example:java.util.Properties props = new java.util.Properties(); props.put(Driver.USER_PROPERTY_KEY,"myName"); props.put(Driver.PASSWORD_PROPERTY_KEY,"myPassword")- Returns:
- A
Connectionobject representing the connection to the database identified by the specified URL, or null if the driver is invalid. - Throws:
EngineRuntimeException- Thrown when the connection cannot be established.java.sql.SQLException- See Also:
Driver.connect(java.lang.String, java.util.Properties)
-
getMajorVersion
public int getMajorVersion()
Gets the major version number for the driver. For example, a driver having version number 1.3 has "1" as its major version number.- Specified by:
getMajorVersionin interfacejava.sql.Driver- Returns:
- An integer representing the major version number.
-
getMinorVersion
public int getMinorVersion()
Get the minor version number for the driver. For example, a driver having version number 1.3 has "3" as its minor version number.- Specified by:
getMinorVersionin interfacejava.sql.Driver- Returns:
- An integer representing the minor version number.
-
getPropertyInfo
public java.sql.DriverPropertyInfo[] getPropertyInfo(java.lang.String url, java.util.Properties info) throws java.sql.SQLExceptionEnables a generic UI tool to discover the properties needed to include in prompts for information sufficient to connect to a database.Note: Additional information may become necessary, based on the prompted values returned. In this case, you need to iterate through additional calls to getPropertyInfo.
- Specified by:
getPropertyInfoin interfacejava.sql.Driver- Parameters:
url- AStringcontaining the URL of the database to connect to. The following is an example of the URL format required (line break for readability):jdbc:filenetp8:http://ceserver:7001/wsi/FNCEWS40MTOM/?objectstores=FileNet1|FileNet2 &mergemode=intersection&jaasconfigname=Jazzinfo- APropertiescollection of field and value pairs to send. For example:java.util.Properties props = new java.util.Properties(); props.put(Driver.USER_PROPERTY_KEY,"myName"); props.put(Driver.PASSWORD_PROPERTY_KEY,"myPassword")- Returns:
- An array of
DriverPropertyInfoobjects describing possible properties. This array may be empty if no properties are required. - Throws:
java.sql.SQLException- See Also:
Driver.getPropertyInfo(java.lang.String, java.util.Properties)
-
jdbcCompliant
public boolean jdbcCompliant()
Indicates whether the driver is JDBC-compliant. JDBC compliance requires full support of the JDBC API and full support for SQL92 Entry Level. The Content Engine is SQL92 compliant, but does not fully support the JDBC API.- Specified by:
jdbcCompliantin interfacejava.sql.Driver- Returns:
- A
booleanvalue of false is always returned.
-
equals
public boolean equals(java.lang.Object obj)
Indicates whether the object specified references this instance.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- An Object to compare to this instance.- Returns:
- A boolean value of true if the object references this instance; false otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object- See Also:
Object.hashCode()
-
-