com.inet.tds
Class DTCDataSource
java.lang.Object
|
+--com.inet.tds.TdsDriver
|
+--com.inet.tds.TdsDataSource
|
+--com.inet.tds.DTCDataSource
- All Implemented Interfaces:
- java.lang.Cloneable, javax.sql.DataSource, java.sql.Driver, javax.naming.Referenceable, java.lang.Runnable, java.io.Serializable, javax.sql.XADataSource
- public class DTCDataSource
- extends TdsDataSource
- implements javax.sql.XADataSource
This class implements the interface XADataSource. It works in conjunction with the MSDTC.
You need to run the DTC on SQL Server site. Before you can use it you need to install
the Resource Manager Proxy of this driver for every instance of the SQL Server.
- See Also:
XDataSource,
TdsDataSource, Serialized Form
|
Method Summary |
java.sql.Connection |
getConnection()
throws ever a SQLException |
java.sql.Connection |
getConnection(java.lang.String username,
java.lang.String password)
throws ever a SQLException |
java.lang.String |
getSystemDatabase()
Get the database for the extended stored procedures to communicate with the MSDTC.
|
javax.sql.XAConnection |
getXAConnection()
Attempt to establish a database connection. |
javax.sql.XAConnection |
getXAConnection(java.lang.String user,
java.lang.String password)
Attempt to establish a database connection. |
void |
setSystemDatabase(java.lang.String systemDatabase)
Set the database for the extended stored procedures to communicate with the MSDTC.
|
| Methods inherited from class com.inet.tds.TdsDataSource |
clone, equals, getCharset, getDatabaseName, getDescription, getInstanceName, getLoginTimeout, getLogWriter, getMode, getPassword, getPort, getPortNumber, getProperties, getProperty, getQueryTimeout, getReference, getServerName, getSqlServer7Mode, getUseCursorsAlways, getUser, setCharset, setDatabaseName, setDescription, setInstanceName, setLoginTimeout, setLogWriter, setMode, setPassword, setPort, setPortNumber, setProperties, setProperty, setProperty, setQueryTimeout, setServerName, setSqlServer7Mode, setUseCursorsAlways, setUser, toString |
| Methods inherited from class com.inet.tds.TdsDriver |
acceptsURL, connect, getMajorVersion, getMinorVersion, getPropertyInfo, jdbcCompliant, run |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.sql.XADataSource |
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter |
DTCDataSource
public DTCDataSource()
getConnection
public java.sql.Connection getConnection()
throws java.sql.SQLException
- throws ever a SQLException
- Overrides:
getConnection in class TdsDataSource
- Following copied from class:
com.inet.tds.TdsDataSource
- Returns:
- a Connection to the database.
- Throws:
java.sql.SQLException -
getConnection
public java.sql.Connection getConnection(java.lang.String username,
java.lang.String password)
throws java.sql.SQLException
- throws ever a SQLException
- Overrides:
getConnection in class TdsDataSource
- Following copied from class:
com.inet.tds.TdsDataSource
- Parameters:
username - the database user on whose behalf the Connection is being made.password - the user's password.- Returns:
- a Connection to the database.
- Throws:
java.sql.SQLException -
getXAConnection
public javax.sql.XAConnection getXAConnection()
throws java.sql.SQLException
- Attempt to establish a database connection.
- Specified by:
getXAConnection in interface javax.sql.XADataSource
- Returns:
- a Connection to the database
getXAConnection
public javax.sql.XAConnection getXAConnection(java.lang.String user,
java.lang.String password)
throws java.sql.SQLException
- Attempt to establish a database connection.
- Specified by:
getXAConnection in interface javax.sql.XADataSource
- Parameters:
user - the database user on whose behalf the Connection is being madepassword - the user's password- Returns:
- a Connection to the database
setSystemDatabase
public void setSystemDatabase(java.lang.String systemDatabase)
- Set the database for the extended stored procedures to communicate with the MSDTC.
The default is the master database.
- Parameters:
sysDatabase - The catalog where you created the extended stored procedures.- Since:
- 4.18
getSystemDatabase
public java.lang.String getSystemDatabase()
- Get the database for the extended stored procedures to communicate with the MSDTC.
The default is the master database.
- Returns:
- The catalog where you created the extended stored procedures.
- Since:
- 4.18
copyright by i-net software