com.filenet.api.jdbc
Class Driver

java.lang.Object
  extended by com.filenet.api.jdbc.Driver
All Implemented Interfaces:
java.sql.Driver

public class Driver
extends java.lang.Object
implements java.sql.Driver

Registers 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 (see SearchScope); 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_ERROR is thrown if the driver registration fails.

Establish a JDBC connection using the connect method. The following values are required, either as part of the connection string or the Properties collection parameter:

The following values are optional when establishing the JDBC connection:

See Also:
MergeMode

Field Summary
static java.lang.String JAASCONFIGNAME_PROPERTY_KEY
          The key for the JAAS configuration name used in the Properties instance passed to the driver.
static java.lang.String LOCALE_PROPERTY_KEY
          The key for the locale value specified in the database URL, or used in the Properties instance passed to the driver.
static java.lang.String MERGEMODE_PROPERTY_KEY
          The key for the merge mode value specified in the database URL, or used in the Properties instance passed to the driver.
static java.lang.String OBJECTSTORES_PROPERTY_KEY
          The key for the object stores value specified in the database URL, or used in the Properties instance passed to the driver.
static java.lang.String PASSWORD_PROPERTY_KEY
          The key for the password value specified in the database URL, or used in the Properties instance passed to the driver.
static java.lang.String URI_PROPERTY_KEY
          The key for the URI value specified in the database URL, or used in the Properties instance passed to the driver.
static java.lang.String USER_PROPERTY_KEY
          The key for the username value specified in the database URL, or used in the Properties instance passed to the driver.
 
Constructor Summary
Driver()
          Registers the JDBC driver.
 
Method Summary
 boolean acceptsURL(java.lang.String url)
          Indicates whether the driver should be able to open a connection to the specified URL.
 java.sql.Connection connect(java.lang.String url, java.util.Properties info)
          Attempts to establish a JDBC connection to the database identified by the specified URL.
 boolean equals(java.lang.Object obj)
          Indicates whether the object specified references this instance.
 int getMajorVersion()
          Gets the major version number for the driver.
 int getMinorVersion()
          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.
 boolean jdbcCompliant()
          Indicates whether the driver is JDBC-compliant.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 the Properties instance 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 the Properties instance 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 the Properties instance passed to the driver. This value is used when multiple object stores are specifed 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 the Properties instance 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 the Properties instance 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 the Properties instance 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
Constructor Detail

Driver

public Driver()
Registers the JDBC driver.

Method Detail

acceptsURL

public boolean acceptsURL(java.lang.String url)
                   throws java.sql.SQLException
Indicates whether the driver should be able to open a connection to the specified URL.

Specified by:
acceptsURL in interface java.sql.Driver
Parameters:
url - A String containing 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/FNCEWS40DIME/?objectstores=FileNet1|FileNet2
          &mergemode=intersection&jaasconfigname=Jazz
 
Returns:
A boolean value 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.SQLException
Attempts to establish a JDBC connection to the database identified by the specified URL. Null is returned if an invalid driver is used for the specified URL. When multiple drivers are loaded, a null return value can occur as the DriverManager passes connection requests to each of the drivers in sequence.

Specified by:
connect in interface java.sql.Driver
Parameters:
url - A String containing 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/FNCEWS40DIME/?objectstores=FileNet1|FileNet2
          &mergemode=intersection&jaasconfigname=Jazz
 
info - A Properties collection 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 Connection object 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:
getMajorVersion in interface java.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:
getMinorVersion in interface java.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.SQLException
Enables 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:
getPropertyInfo in interface java.sql.Driver
Parameters:
url - A String containing 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/FNCEWS40DIME/?objectstores=FileNet1|FileNet2
          &mergemode=intersection&jaasconfigname=Jazz
 
info - A Properties collection 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 DriverPropertyInfo objects 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:
jdbcCompliant in interface java.sql.Driver
Returns:
A boolean value of false is always returned.

equals

public boolean equals(java.lang.Object obj)
Indicates whether the object specified references this instance.

Overrides:
equals in class java.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.


© Copyright IBM Corporation 2006, 2008. All rights reserved.