|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.metamatrix.jdbc.WrapperImpl
com.metamatrix.jdbc.BaseDataSource
org.teiid.jdbc.TeiidDataSource
public class TeiidDataSource
The MetaMatrix JDBC DataSource implementation class of DataSource
and
XADataSource
.
The DataSource
interface follows the JavaBean design pattern,
meaning the implementation class has properties that are accessed with getter methods
and set using setter methods, and where the getter and setter methods follow the JavaBean
naming convention (e.g., get
PropertyName() :
PropertyType
and set
PropertyName(
PropertyType) : void
).
XADataSource
interface is almost identical to the DataSource
interface, but rather than returning Connection
instances, there are methods that
return XAConnection
instances that can be used with distributed transactions.
The following are the properties for this DataSource:
Property Name | Type | Description | ||||||||
portNumber | int | The port number where a MetaMatrix Server is listening for requests. | ||||||||
serverName | String | The hostname or IP address of the MetaMatrix Server. |
Field Summary |
---|
Fields inherited from class com.metamatrix.jdbc.BaseDataSource |
---|
APP_NAME, DEFAULT_APP_NAME, DEFAULT_FETCH_SIZE, DEFAULT_LOG_LEVEL, DEFAULT_PARTIAL_RESULTS_MODE, DEFAULT_RESULT_SET_CACHE_MODE, DEFAULT_TIMEOUT, JDBC, METAMATRIX_PROTOCOL, PASSWORD, TXN_AUTO_WRAP_OFF, TXN_AUTO_WRAP_ON, TXN_AUTO_WRAP_OPTIMISTIC, TXN_AUTO_WRAP_PESSIMISTIC, USER_NAME, VDB_NAME, VDB_VERSION, VERSION |
Constructor Summary | |
---|---|
TeiidDataSource()
Constructor for MMDataSource. |
Method Summary | |
---|---|
protected java.util.Properties |
buildProperties(java.lang.String userName,
java.lang.String password)
|
protected java.lang.String |
buildServerURL()
|
protected java.lang.String |
buildURL()
|
java.lang.String |
getAlternateServers()
Returns a string containing a comma delimited list of alternate MetaMatrix Server(s). |
java.lang.String |
getAutoFailover()
|
java.sql.Connection |
getConnection()
Attempt to establish a database connection. |
java.sql.Connection |
getConnection(java.lang.String userName,
java.lang.String password)
Attempt to establish a database connection. |
java.lang.String |
getCredentials()
Returns the credentials string defining credentials to use with connectors for per-user logon. |
java.lang.String |
getDiscoveryStrategy()
|
java.lang.String |
getEmbeddedBootstrapFile()
Returns the path and file name from which embedded DQP configuration information will be read. |
int |
getPortNumber()
Returns the port number. |
java.lang.String |
getServerName()
Returns the name of the MetaMatrix Server. |
boolean |
isSecure()
Returns a flag indicating whether to create a secure connection or not. |
static java.lang.String |
reasonWhyInvalidAlternateServers(java.lang.String alternateServers)
The reason why "alternateServers" is invalid. |
static java.lang.String |
reasonWhyInvalidConfigFile(java.lang.String configFile)
Return the reason why the supplied config file may be invalid, or null if it is considered valid. |
static java.lang.String |
reasonWhyInvalidPortNumber(int portNumber)
Return the reason why the supplied port number may be invalid, or null if it is considered valid. |
static java.lang.String |
reasonWhyInvalidServerName(java.lang.String serverName)
Return the reason why the supplied server name may be invalid, or null if it is considered valid. |
static java.lang.String |
reasonWhyInvalidSocketsPerVM(java.lang.String socketsPerVM)
The reason why "socketsPerVM" is invalid. |
static java.lang.String |
reasonWhyInvalidStickyConnections(java.lang.String stickyConnections)
The reason why "stickyConnections" is invalid. |
void |
setAlternateServers(java.lang.String servers)
Sets a list of alternate MetaMatrix Sserver(s) that can be used for connection fail-over. |
void |
setAutoFailover(java.lang.String autoFailover)
|
void |
setCredentials(java.lang.String credentials)
Sets the credentials string defining credentials to use with connectors for per-user logon. |
void |
setDiscoveryStrategy(java.lang.String discoveryStrategy)
|
void |
setEmbeddedBootstrapFile(java.lang.String configFile)
Sets file name from which embedded DQP configuration information * will be read. |
void |
setPortNumber(int portNumber)
Sets the portNumber. |
void |
setSecure(boolean secure)
Sets the secure flag to use mms: protocol instead of the default mm: protocol. |
void |
setServerName(java.lang.String serverName)
Sets the serverName. |
java.lang.String |
toString()
|
protected void |
validateProperties(java.lang.String userName,
java.lang.String password)
|
Methods inherited from class com.metamatrix.jdbc.WrapperImpl |
---|
isWrapperFor, unwrap |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.sql.Wrapper |
---|
isWrapperFor, unwrap |
Constructor Detail |
---|
public TeiidDataSource()
Method Detail |
---|
protected java.util.Properties buildProperties(java.lang.String userName, java.lang.String password)
buildProperties
in class BaseDataSource
protected java.lang.String buildServerURL()
protected java.lang.String buildURL()
protected void validateProperties(java.lang.String userName, java.lang.String password) throws java.sql.SQLException
validateProperties
in class BaseDataSource
java.sql.SQLException
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
getConnection
in class BaseDataSource
java.sql.SQLException
- if a database-access error occursDataSource.getConnection()
public java.sql.Connection getConnection(java.lang.String userName, java.lang.String password) throws java.sql.SQLException
userName
- the database user on whose behalf the Connection is being madepassword
- the user's password
java.sql.SQLException
- if a database-access error occursDataSource.getConnection(java.lang.String, java.lang.String)
public java.lang.String toString()
toString
in class java.lang.Object
Object.toString()
public int getPortNumber()
public java.lang.String getServerName()
public java.lang.String getCredentials()
public boolean isSecure()
public java.lang.String getAlternateServers()
null
is returned.
null
If
no alternate servers are defined.public void setPortNumber(int portNumber)
portNumber
- The portNumber to setpublic void setServerName(java.lang.String serverName)
serverName
- The serverName to setpublic void setCredentials(java.lang.String credentials)
public void setSecure(boolean secure)
secure
- True to use mms:public void setAlternateServers(java.lang.String servers)
portNumber
is used.
If servers
is empty or null
, the value of
alternateServers
is cleared.
servers
- A comma delimited list of alternate MetaMatrix
Server(s):Port(s) to use for connection fail-over. If blank or
null
, the list is cleared.public static java.lang.String reasonWhyInvalidPortNumber(int portNumber)
portNumber
- a possible value for the property
setPortNumber(int)
public static java.lang.String reasonWhyInvalidServerName(java.lang.String serverName)
serverName
- a possible value for the property
setServerName(String)
public static java.lang.String reasonWhyInvalidSocketsPerVM(java.lang.String socketsPerVM)
value
- of "socketsPerVM" property
public static java.lang.String reasonWhyInvalidStickyConnections(java.lang.String stickyConnections)
value
- of "stickyConnections" property
public static java.lang.String reasonWhyInvalidAlternateServers(java.lang.String alternateServers)
value
- of "alternateServers" property
public java.lang.String getAutoFailover()
public void setAutoFailover(java.lang.String autoFailover)
transparentFailover
- The transparentFailover to set.public java.lang.String getDiscoveryStrategy()
public void setDiscoveryStrategy(java.lang.String discoveryStrategy)
public java.lang.String getEmbeddedBootstrapFile()
public void setEmbeddedBootstrapFile(java.lang.String configFile)
configFile
- The name of the config file name to setpublic static java.lang.String reasonWhyInvalidConfigFile(java.lang.String configFile)
configFile
- a possible value for the property
setEmbeddedBootstrapFile(String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |