DEPRECATED

# com.bea.p13n.content.document.jdbc
Connection Class

public class Connection
extends `Object`
implements `Connection`

A connection to a DMS via an internally used DocumentProvider.

All the real functionality of this class is in the prepareCall() method.

Related Topics

``Driver``
``Connection.prepareCall(String)``

Hierarchy
  `Object`
  `Connection`

All Implemented Interfaces
  `Connection`

## Field Summary

`public static final `String`` | `DOCUMENT_PROVIDER_PROP` The property name of the DocumentProvider class to use.
`protected `com.bea.p13n.content.document.spi.DocumentProvider`` | `provider` The document provider we're using.

## Constructor Summary

Connection(`DocumentProvider` provider) Constructor.
Connection(`String` url, `Properties` props, `ClassLoader` classLoader) Constructor.
Connection(`String` url, `Properties` props) Constructor.

## Method Summary

`public void` | `clearWarnings`() Intentional empty implementation.
`public void` | `close`() This will close the DocumentProvider
`public void` | `commit`() Ignored.
`public `DocumentProvider`` | `createDocumentProvider`(`Properties` p, `ClassLoader` classLoader) Create and initialize a DocumentProvider from the given properties.
`public `DocumentProvider`` | `createDocumentProvider`(`Properties` p) Create and initialize a DocumentProvider from the given properties.
`public static `DocumentProvider`` | `createDocumentProvider`(`String` clName, `Properties` p, `ClassLoader` classLoader) Create and initialize a DocumentProvider.
`public static `DocumentProvider`` | `createDocumentProvider`(`String` clName, `Properties` p) Create and initialize a DocumentProvider.
`public `Statement`` | `createStatement`() Not supported.
`public `Statement`` | `createStatement`(int resultSetType, int resultSetConcurrency) Not supported.
`public `Statement`` | `createStatement`(int resultSetType, int resultSetConcurrency, int resultSetHoldability) Not supported.
`public boolean` | `getAutoCommit`() We're readonly anyways.
`public `String`` | `getCatalog`() Not supported.
`protected `DocumentProvider`` | `getDocumentProvider`() Get the document provider used.
`public int` | `getHoldability`()
`public `DatabaseMetaData`` | `getMetaData`() Not supported.
`public int` | `getTransactionIsolation`() Get the transaction isolation level used by the document provider.
`public `Map`` | `getTypeMap`() Not supported.
`public `SQLWarning`` | `getWarnings`() Intentional empty implementation.
`public boolean` | `isClosed`() Tell if this connection/document provider has been closed.
`public boolean` | `isReadOnly`() DocumentProvider's are read only.
`public `String`` | `nativeSQL`(`String` sql) Not supported.
`public `CallableStatement`` | `prepareCall`(`String` sql) Prepare a Callable statement for use.
`public `CallableStatement`` | `prepareCall`(`String` sql, int resultSetType, int resultSetConcurrency)
`public `CallableStatement`` | `prepareCall`(`String` sql, int resultSetType, int resultSetConcurrency, int holdability)
`public `PreparedStatement`` | `prepareStatement`(`String` sql) Not supported.
`public `PreparedStatement`` | `prepareStatement`(`String` sql, int resultSetType, int resultSetConcurrency) Not supported.
`public `PreparedStatement`` | `prepareStatement`(`String` sql, int autoGeneratedKeys) Not supported.
`public `PreparedStatement`` | `prepareStatement`(`String` sql, int type, int concurrency, int holdability) Not supported.
`public `PreparedStatement`` | `prepareStatement`(`String` sql, int[] columnIndexes) Not supported.
`public `PreparedStatement`` | `prepareStatement`(`String` sql, `String`[] columnNames) Not supported.
`public void` | `releaseSavepoint`(`Savepoint` savepoint)
`public void` | `rollback`() This will reset the DocumentProvider.
`public void` | `rollback`(`Savepoint` savepoint)
`public void` | `setAutoCommit`(boolean autoCommit) Ignored.
`public void` | `setCatalog`(`String` catalog) Not supported.
`protected void` | `setDocumentProvider`(`DocumentProvider` provider) Set the document provider to use.
`public void` | `setHoldability`(int holdability)
`public void` | `setReadOnly`(boolean readOnly) Ignored.
`public `Savepoint`` | `setSavepoint`()
`public `Savepoint`` | `setSavepoint`(`String` name)
`public void` | `setTransactionIsolation`(int level) Set the transaction isolation level on the document provider.
`public void` | `setTypeMap`(`Map` map) Not supported.

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `java.sql.`Connection``
`clearWarnings, close, commit, createStatement, createStatement, createStatement, getAutoCommit, getCatalog, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap`

## Field Detail

### DOCUMENT_PROVIDER_PROP

    public static final String DOCUMENT_PROVIDER_PROP

  The property name of the DocumentProvider class to use.

### provider

    protected com.bea.p13n.content.document.spi.DocumentProvider provider

  The document provider we're using.

## Constructor Detail

### Connection

    protected Connection(DocumentProvider provider)

  Constructor.

Related Topics

``Connection.setDocumentProvider(DocumentProvider)``

### Connection

    public Connection(String url,
                      Properties props,
                      ClassLoader classLoader)

  Constructor.

  This will pull the class name of the DocumentProvider to use from the properties at DOCUMENT_PROVIDER_PROP ("documentProvider"). It will instantiate the provider and initialize it.

Related Topics

``Connection.createDocumentProvider(Properties, ClassLoader)``

### Connection

    public Connection(String url,
                      Properties props)

  Constructor.

  This will pull the class name of the DocumentProvider to use from the properties at DOCUMENT_PROVIDER_PROP ("documentProvider"). It will instantiate the provider and initialize it.

Related Topics

``Connection.createDocumentProvider(Properties, ClassLoader)``

## Method Detail

### clearWarnings() Method

    public void clearWarnings()

Intentional empty implementation.

### close() Method

    public void close()
         throws SQLException

This will close the DocumentProvider

#### Exceptions

``SQLException``
  thrown on an error.

Related Topics

``DocumentProvider.close()``

### commit() Method

    public void commit()

Ignored.

### createDocumentProvider(Properties, ClassLoader) Method

    public DocumentProvider createDocumentProvider(Properties p,
                                                   ClassLoader classLoader)
         throws DocumentException

Create and initialize a DocumentProvider from the given properties.

This is called by the constructor. This method will pull the document provider class name from the properties, load the class, create an instance, and initialize it. Subclasses can override to modify where the DocumentProvider comes from.

#### Parameters

p
  the properties.

#### Returns

the DocumentProvider.

#### Exceptions

``DocumentException``
  thrown on an error

Related Topics

``Connection.createDocumentProvider(String, Properties)``

### createDocumentProvider(Properties) Method

    public DocumentProvider createDocumentProvider(Properties p)
         throws DocumentException

Create and initialize a DocumentProvider from the given properties.

This is called by the constructor. This method will pull the document provider class name from the properties, load the class, create an instance, and initialize it. Subclasses can override to modify where the DocumentProvider comes from.

#### Parameters

p
  the properties.

#### Returns

the DocumentProvider.

#### Exceptions

``DocumentException``
  thrown on an error

Related Topics

``Connection.createDocumentProvider(String, Properties)``

### createDocumentProvider(String, Properties, ClassLoader) Method

    public static DocumentProvider createDocumentProvider(String clName,
                                                          Properties p,
                                                          ClassLoader classLoader)
         throws DocumentException

Create and initialize a DocumentProvider.

This will load the specified class, create an instance, cast it to DocumentProvider, and invoke init() on that. It will also wrap any exceptions into a DocumentException.

#### Parameters

clName
  the class name of the document provider.

p
  the configuration properties to initialize the provider with.

#### Returns

the initialize document provider.

#### Exceptions

``DocumentException``
  thrown on an error.

### createDocumentProvider(String, Properties) Method

    public static DocumentProvider createDocumentProvider(String clName,
                                                          Properties p)
         throws DocumentException

Create and initialize a DocumentProvider.

This will load the specified class, create an instance, cast it to DocumentProvider, and invoke init() on that. It will also wrap any exceptions into a DocumentException.

#### Parameters

clName
  the class name of the document provider.

p
  the configuration properties to initialize the provider with.

#### Returns

the initialize document provider.

#### Exceptions

``DocumentException``
  thrown on an error.

### createStatement() Method

    public Statement createStatement()
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### createStatement(int, int) Method

    public Statement createStatement(int resultSetType,
                                     int resultSetConcurrency)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.createStatement()``

### createStatement(int, int, int) Method

    public Statement createStatement(int resultSetType,
                                     int resultSetConcurrency,
                                     int resultSetHoldability)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.createStatement()``

### getAutoCommit() Method

    public boolean getAutoCommit()

We're readonly anyways.

#### Returns

true.

### getCatalog() Method

    public String getCatalog()
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### getDocumentProvider() Method

    protected DocumentProvider getDocumentProvider()
         throws DocumentException

Get the document provider used.

#### Exceptions

``DocumentException``
  thrown if the provider is null (i.e. closed or uninitialized).

### getHoldability() Method

    public int getHoldability()
         throws SQLException

#### Exceptions

``SQLException``

### getMetaData() Method

    public DatabaseMetaData getMetaData()
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### getTransactionIsolation() Method

    public int getTransactionIsolation()
         throws SQLException

Get the transaction isolation level used by the document provider.

#### Exceptions

``SQLException``
  thrown on an error.

Related Topics

``DocumentProvider.getTransactionIsolation()``

### getTypeMap() Method

    public Map getTypeMap()
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### getWarnings() Method

    public SQLWarning getWarnings()

Intentional empty implementation.

### isClosed() Method

    public boolean isClosed()

Tell if this connection/document provider has been closed.

#### Returns

true if it's already closed, false if not.

### isReadOnly() Method

    public boolean isReadOnly()

DocumentProvider's are read only.

#### Returns

true

### nativeSQL(String) Method

    public String nativeSQL(String sql)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown

### prepareCall(String) Method

    public CallableStatement prepareCall(String sql)
         throws SQLException

Prepare a Callable statement for use.

The prepareCall method understands the following query strings. The required input params and output params are also documented:

- `findDocuments`: Param1 must be either a Search or a String (which is the query string). Output 1 will be a DocumentIterator of the DocumentDefs which match.
- `findDocumentIds`: Param1 must be either a Search or a String (which is the query string). Output 1 will be a DocumentIterator of the String document ids which match.
- `findDocumentMetadata`: Param1 must be either a Search or a String (which is the query string). Output1 will be a DocumentIterator of the DocumentMetadataDefs which match.
- `getDocumentMetadata`: Param1 must be the String document id. Ouptut1 will be the DocumentMetadataDef of the document with the id, or null if unknown id.
- `getDocumentModifiedDate`: Param1 must be the String document id. Output1 will be the Timestamp last modified time of the document, or null if unknown.
- `getDocument`: Param1 must be the String document id. Ouptut1 will be the DocumentDef of the document with the id, or null if unknown id.
- `getSchemaNames`: Output1 will be a DocumentIterator of the schema names (Strings).
- `getSchema`: Param1 must be the String name of the schema. Output1 will be the DocumentSchemaDef or null.
- `getSchemas`: Output1 will be the Map of schema name to DocumentSchemaDef.

#### Parameters

sql
  the function to execute.

#### Returns

a CallableStatement which can be used to execute the query.

#### Exceptions

``SQLException``
  thrown on invalid sql.

### prepareCall(String, int, int) Method

    public CallableStatement prepareCall(String sql,
                                         int resultSetType,
                                         int resultSetConcurrency)
         throws SQLException

#### Parameters

sql
  the sql statement.

resultSetType
  ignored.

resultSetConcurrency
  ignored.

#### Returns

a CallableStatement

#### Exceptions

``SQLException``
  thrown on invalid sql.

Related Topics

``Connection.prepareCall(String)``

### prepareCall(String, int, int, int) Method

    public CallableStatement prepareCall(String sql,
                                         int resultSetType,
                                         int resultSetConcurrency,
                                         int holdability)
         throws SQLException

#### Parameters

sql
  the sql statement.

resultSetType
  ignored.

resultSetConcurrency
  ignored.

holdability
  ignored.

#### Returns

a CallableStatement

#### Exceptions

``SQLException``
  thrown on invalid sql.

Related Topics

``Connection.prepareCall(String)``

### prepareStatement(String) Method

    public PreparedStatement prepareStatement(String sql)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### prepareStatement(String, int, int) Method

    public PreparedStatement prepareStatement(String sql,
                                              int resultSetType,
                                              int resultSetConcurrency)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.prepareStatement(String)``

### prepareStatement(String, int) Method

    public PreparedStatement prepareStatement(String sql,
                                              int autoGeneratedKeys)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.prepareStatement(String)``

### prepareStatement(String, int, int, int) Method

    public PreparedStatement prepareStatement(String sql,
                                              int type,
                                              int concurrency,
                                              int holdability)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.prepareStatement(String)``

### prepareStatement(String, int[]) Method

    public PreparedStatement prepareStatement(String sql,
                                              int[] columnIndexes)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.prepareStatement(String)``

### prepareStatement(String, String[]) Method

    public PreparedStatement prepareStatement(String sql,
                                              String[] columnNames)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

Related Topics

``Connection.prepareStatement(String)``

### releaseSavepoint(Savepoint) Method

    public void releaseSavepoint(Savepoint savepoint)
         throws SQLException

#### Exceptions

``SQLException``

### rollback() Method

    public void rollback()
         throws SQLException

This will reset the DocumentProvider.

#### Exceptions

``SQLException``
  thrown on an error.

Related Topics

``DocumentProvider.reset()``

### rollback(Savepoint) Method

    public void rollback(Savepoint savepoint)
         throws SQLException

#### Exceptions

``SQLException``

### setAutoCommit(boolean) Method

    public void setAutoCommit(boolean autoCommit)

Ignored.

### setCatalog(String) Method

    public void setCatalog(String catalog)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.

### setDocumentProvider(DocumentProvider) Method

    protected void setDocumentProvider(DocumentProvider provider)

Set the document provider to use.

### setHoldability(int) Method

    public void setHoldability(int holdability)
         throws SQLException

#### Exceptions

``SQLException``

### setReadOnly(boolean) Method

    public void setReadOnly(boolean readOnly)

Ignored.

### setSavepoint() Method

    public Savepoint setSavepoint()
         throws SQLException

#### Exceptions

``SQLException``

### setSavepoint(String) Method

    public Savepoint setSavepoint(String name)
         throws SQLException

#### Exceptions

``SQLException``

### setTransactionIsolation(int) Method

    public void setTransactionIsolation(int level)
         throws SQLException

Set the transaction isolation level on the document provider.

#### Parameters

level
  one of the TRANSACTION_* values.

#### Exceptions

``SQLException``
  throw on an error.

Related Topics

``DocumentProvider.setTransactionIsolation(int)``

### setTypeMap(Map) Method

    public void setTypeMap(Map map)
         throws SQLException

Not supported.

#### Exceptions

``SQLException``
  always thrown.