public class TeiidDataSource extends BaseDataSource
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 Teiid Server is listening for requests. |
serverName | String | The hostname or IP address of the Teiid Server. |
Constructor and Description |
---|
TeiidDataSource() |
Modifier and Type | Method and Description |
---|---|
protected Properties |
buildProperties(String userName,
String password) |
protected String |
buildServerURL() |
protected JDBCURL |
buildURL() |
String |
getAlternateServers()
Returns a string containing a comma delimited list of alternate
server(s).
|
String |
getAutoFailover() |
Connection |
getConnection()
Attempt to establish a database connection.
|
Connection |
getConnection(String userName,
String password)
Attempt to establish a database connection.
|
boolean |
getEncryptRequests() |
String |
getJaasName()
Application name from JAAS Login Config file
|
String |
getKerberosServicePrincipleName()
Kerberos KDC service principle name
|
boolean |
getLoadBalance()
Deprecated.
|
Logger |
getParentLogger() |
boolean |
getPassthroughAuthentication()
Same as "isPassthroughAuthentication".
|
int |
getPortNumber()
Returns the port number.
|
boolean |
getSecure()
Same as "isSecure".
|
String |
getServerName()
Returns the name of the server.
|
XAConnection |
getXAConnection(String userName,
String password)
Attempt to establish a database connection that can be used with distributed transactions.
|
boolean |
isEncryptRequests() |
boolean |
isLoadBalance()
Deprecated.
|
boolean |
isPassthroughAuthentication()
When true, this connection uses the passed in security domain to do the authentication.
|
boolean |
isSecure()
Returns a flag indicating whether to create a secure connection or not.
|
static String |
reasonWhyInvalidPortNumber(int portNumber)
Return the reason why the supplied port number may be invalid, or null
if it is considered valid.
|
static String |
reasonWhyInvalidServerName(String serverName)
Return the reason why the supplied server name may be invalid, or null
if it is considered valid.
|
static String |
reasonWhyInvalidSocketsPerVM(String socketsPerVM)
The reason why "socketsPerVM" is invalid.
|
static String |
reasonWhyInvalidStickyConnections(String stickyConnections)
The reason why "stickyConnections" is invalid.
|
void |
setAlternateServers(String servers)
Sets a list of alternate server(s) that can be used for
connection fail-over.
|
void |
setAutoFailover(String autoFailover) |
void |
setEncryptRequests(boolean encryptRequests) |
void |
setJaasName(String jaasApplicationName)
Application name from JAAS Login Config file
|
void |
setKerberosServicePrincipleName(String kerberosServerName)
Kerberos KDC service principle name
|
void |
setLoadBalance(boolean loadBalance)
Deprecated.
|
void |
setPassthroughAuthentication(boolean passthroughAuthentication)
When set to true, the connection uses the passed in security domain to do the authentication.
|
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(String serverName)
Sets the serverName.
|
String |
toString() |
protected void |
validateProperties(String userName,
String password) |
getAdditionalProperties, getApplicationName, getAutoCommitTxn, getDatabaseName, getDatabaseVersion, getDataSourceName, getDescription, getDisableLocalTxn, getFetchSize, getLoginTimeout, getLogWriter, getPartialResultsMode, getPassword, getPooledConnection, getPooledConnection, getQueryTimeout, getResultSetCacheMode, getShowPlan, getUseJDBC4ColumnNameAndLabelSemantics, getUser, getXAConnection, isAnsiQuotedIdentifiers, isNoExec, reasonWhyInvalidApplicationName, reasonWhyInvalidDatabaseName, reasonWhyInvalidDatabaseVersion, reasonWhyInvalidDataSourceName, reasonWhyInvalidDescription, reasonWhyInvalidFetchSize, reasonWhyInvalidPartialResultsMode, reasonWhyInvalidPassword, reasonWhyInvalidTransactionAutoWrap, reasonWhyInvalidUser, setAdditionalProperties, setAnsiQuotedIdentifiers, setApplicationName, setAutoCommitTxn, setDatabaseName, setDatabaseVersion, setDataSourceName, setDescription, setDisableLocalTxn, setFetchSize, setLoginTimeout, setLogWriter, setNoExec, setPartialResultsMode, setPassword, setQueryTimeout, setResultSetCacheMode, setShowPlan, setUseJDBC4ColumnNameAndLabelSemantics, setUser
isWrapperFor, unwrap
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
isWrapperFor, unwrap
protected Properties buildProperties(String userName, String password)
buildProperties
in class BaseDataSource
protected String buildServerURL() throws TeiidSQLException
TeiidSQLException
protected JDBCURL buildURL() throws TeiidSQLException
TeiidSQLException
protected void validateProperties(String userName, String password) throws SQLException
validateProperties
in class BaseDataSource
SQLException
public Connection getConnection() throws SQLException
getConnection
in interface DataSource
getConnection
in class BaseDataSource
SQLException
- if a database-access error occursDataSource.getConnection()
public Connection getConnection(String userName, String password) throws SQLException
userName
- the database user on whose behalf the Connection is being madepassword
- the user's passwordSQLException
- if a database-access error occursDataSource.getConnection(java.lang.String, java.lang.String)
public String toString()
toString
in class Object
Object.toString()
public int getPortNumber()
public String getServerName()
public boolean isSecure()
public boolean getSecure()
public String getAlternateServers()
null
is returned.null
If
no alternate servers are defined.public void setPortNumber(int portNumber)
portNumber
- The portNumber to setpublic void setServerName(String serverName)
serverName
- The serverName to setpublic void setSecure(boolean secure)
secure
- True to use mms:public void setAlternateServers(String servers)
portNumber
is used.
If servers
is empty or null
, the value of
alternateServers
is cleared.servers
- A comma delimited list of alternate
Server(s):Port(s) to use for connection fail-over. If blank or
null
, the list is cleared.public static String reasonWhyInvalidPortNumber(int portNumber)
portNumber
- a possible value for the propertysetPortNumber(int)
public static String reasonWhyInvalidServerName(String serverName)
serverName
- a possible value for the propertysetServerName(String)
public static String reasonWhyInvalidSocketsPerVM(String socketsPerVM)
value
- of "socketsPerVM" propertypublic static String reasonWhyInvalidStickyConnections(String stickyConnections)
value
- of "stickyConnections" propertypublic String getAutoFailover()
public void setAutoFailover(String autoFailover)
transparentFailover
- The transparentFailover to set.public boolean isPassthroughAuthentication()
public boolean getPassthroughAuthentication()
public void setPassthroughAuthentication(boolean passthroughAuthentication)
public String getJaasName()
public void setJaasName(String jaasApplicationName)
public String getKerberosServicePrincipleName()
public void setKerberosServicePrincipleName(String kerberosServerName)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
public void setEncryptRequests(boolean encryptRequests)
public boolean isEncryptRequests()
public boolean getEncryptRequests()
@Deprecated public boolean isLoadBalance()
@Deprecated public boolean getLoadBalance()
@Deprecated public void setLoadBalance(boolean loadBalance)
public XAConnection getXAConnection(String userName, String password) throws SQLException
userName
- the database user on whose behalf the XAConnection is being madepassword
- the user's passwordSQLException
- if a database-access error occursXADataSource.getXAConnection(java.lang.String, java.lang.String)
Copyright © 2019. All rights reserved.