org.teiid.connector.jdbc
Class JDBCConnector

java.lang.Object
  extended by org.teiid.connector.basic.BasicConnector
      extended by org.teiid.connector.jdbc.JDBCConnector
All Implemented Interfaces:
Connector, XAConnector
Direct Known Subclasses:
OracleSpatialConnector

public class JDBCConnector
extends BasicConnector
implements XAConnector

JDBC implementation of Connector interface.


Field Summary
protected  ConnectorEnvironment environment
           
static java.lang.String INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS
           
 
Constructor Summary
JDBCConnector()
           
 
Method Summary
protected  void createDataSources(java.lang.String dataSourceClassName, java.util.Properties connectionProps)
           
 Connection createJDBCSourceConnection(java.sql.Connection conn, ConnectorEnvironment env, Translator trans)
           
 XAConnection createJDBCSourceXAConnection(javax.sql.XAConnection conn, java.sql.Connection c, ConnectorEnvironment env, Translator trans)
           
 ConnectorCapabilities getCapabilities()
          Get the capabilities of this connector.
 Connection getConnection(ExecutionContext context)
          Obtain a connection with the connector.
 javax.sql.DataSource getDataSource()
           
 int getDefaultTransactionIsolationLevel()
           
 XAConnection getXAConnection(ExecutionContext context, TransactionContext transactionContext)
          Obtain a connection with the connector.
 javax.sql.XADataSource getXADataSource()
           
protected  void setDefaultTransactionIsolationLevel(java.sql.Connection sqlConn)
           
 void start(ConnectorEnvironment environment)
          Start the connector with the connector environment.
 void stop()
          Stop the connector.
 
Methods inherited from class org.teiid.connector.basic.BasicConnector
areAdminConnectionsAllowed, createIdentity, getConnectorName, setAdminConnectionsAllowed, setConnectorName, setUseCredentialMap, useCredentialMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.teiid.connector.api.Connector
createIdentity
 

Field Detail

INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS

public static final java.lang.String INVALID_AUTHORIZATION_SPECIFICATION_NO_SUBCLASS
See Also:
Constant Field Values

environment

protected ConnectorEnvironment environment
Constructor Detail

JDBCConnector

public JDBCConnector()
Method Detail

start

public void start(ConnectorEnvironment environment)
           throws ConnectorException
Description copied from interface: Connector
Start the connector with the connector environment. The environment provides access to external resources the connector implementation may need to use.

Specified by:
start in interface Connector
Overrides:
start in class BasicConnector
Parameters:
environment - The connector environment, provided by the Connector Manager
Throws:
ConnectorException

stop

public void stop()
Description copied from interface: Connector
Stop the connector. No commands will be executed on the connector when it is stopped.

Specified by:
stop in interface Connector

getConnection

public Connection getConnection(ExecutionContext context)
                         throws ConnectorException
Description copied from interface: Connector
Obtain a connection with the connector. The connection typically is associated with a particular security context. The connection is assumed to be pooled in the underlying source if pooling is necessary - the connection will be closed when execution has completed against it.

Specified by:
getConnection in interface Connector
Parameters:
context - The context of the current user that will be using this connection, may be null if this connection is for an administrative operation.
Returns:
A Connection, created by the Connector
Throws:
ConnectorException - If an error occurred obtaining a connection

createJDBCSourceConnection

public Connection createJDBCSourceConnection(java.sql.Connection conn,
                                             ConnectorEnvironment env,
                                             Translator trans)
                                      throws ConnectorException
Throws:
ConnectorException

getXAConnection

public XAConnection getXAConnection(ExecutionContext context,
                                    TransactionContext transactionContext)
                             throws ConnectorException
Description copied from interface: XAConnector
Obtain a connection with the connector. The connection must have XAResource in order to participate in distributed transaction. The connection typically is associated with a particular context.

Specified by:
getXAConnection in interface XAConnector
transactionContext - The context of the transaction under which the connection will be used. May be null.
Returns:
A Connection, created by the Connector
Throws:
ConnectorException - If an error occurred obtaining a connection

createJDBCSourceXAConnection

public XAConnection createJDBCSourceXAConnection(javax.sql.XAConnection conn,
                                                 java.sql.Connection c,
                                                 ConnectorEnvironment env,
                                                 Translator trans)
                                          throws ConnectorException,
                                                 java.sql.SQLException
Throws:
ConnectorException
java.sql.SQLException

getCapabilities

public ConnectorCapabilities getCapabilities()
Description copied from interface: Connector
Get the capabilities of this connector. The capabilities affect what kinds of queries (and other commands) will be sent to the connector.

Specified by:
getCapabilities in interface Connector
Returns:
ConnectorCapabilities, may return null if the Connector provides User scoped capabilities Connection.getCapabilities()

createDataSources

protected void createDataSources(java.lang.String dataSourceClassName,
                                 java.util.Properties connectionProps)
                          throws ConnectorException
Throws:
ConnectorException

getDataSource

public javax.sql.DataSource getDataSource()

getXADataSource

public javax.sql.XADataSource getXADataSource()

getDefaultTransactionIsolationLevel

public int getDefaultTransactionIsolationLevel()

setDefaultTransactionIsolationLevel

protected void setDefaultTransactionIsolationLevel(java.sql.Connection sqlConn)
                                            throws java.sql.SQLException
Throws:
java.sql.SQLException


Copyright © 2009. All Rights Reserved.