i-net JDBC drivers for MS SQL Server

com.inet.tds
Class DTCDataSource

java.lang.Object
  extended by com.inet.tds.TdsDriver
      extended by com.inet.tds.TdsDataSource
          extended by com.inet.tds.DTCDataSource
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.sql.Driver, java.sql.Wrapper, javax.naming.Referenceable, javax.sql.CommonDataSource, javax.sql.DataSource, javax.sql.XADataSource
Direct Known Subclasses:
DTCDataSource4

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:
TdsDataSource, Serialized Form

Field Summary
 
Fields inherited from class com.inet.tds.TdsDataSource
MODE_SQLSERVER_65, MODE_SQLSERVER_70, MODE_SQLSERVER_70_ASCII
 
Constructor Summary
DTCDataSource()
           
 
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, getAppname, getCharset, getDatabaseName, getDescription, getDstsave, getFailover, getFailoverInstanceName, getFailoverPort, getFailoverServerName, getFetchsize, getFulltran, getImpltran, getInitSQL, getInstanceName, getJAVA_OBJECT, getLanguage, getLastUpdateCount, getLoginTimeout, getLogWriter, getMode, getPacketSize, getPassword, getPort, getPortNumber, getPrepare, getPrepareLiveTime, getProperties, getProperty, getQueryTimeout, getReference, getResultSetType, getSecureLevel, getServerName, getSqlServer7Mode, getStatusRequest, getUrl, getUseCursorsAlways, getUseInsteadOfTrigger, getUser, getWSID, isMars, setAppname, setCharset, setDatabaseName, setDescription, setDstsave, setFailover, setFailoverInstanceName, setFailoverPort, setFailoverServerName, setFetchsize, setFulltran, setFulltran, setImpltran, setImpltran, setInitSQL, setInstanceName, setJAVA_OBJECT, setLanguage, setLastUpdateCount, setLogging, setLoginTimeout, setLogWriter, setMars, setMode, setPacketSize, setPassword, setPort, setPortNumber, setPrepare, setPrepareLiveTime, setProperties, setProperty, setProperty, setProperty, setQueryTimeout, setResultSetType, setSecureLevel, setServerName, setSqlServer7Mode, setStatusRequest, setUrl, setUseCursorsAlways, setUseInsteadOfTrigger, setUser, setWSID, 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.CommonDataSource
getLoginTimeout, getLogWriter, setLoginTimeout, setLogWriter
 
Methods inherited from interface java.sql.Wrapper
isWrapperFor, unwrap
 

Constructor Detail

DTCDataSource

public DTCDataSource()
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
throws ever a SQLException

Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class 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

Specified by:
getConnection in interface javax.sql.DataSource
Overrides:
getConnection in class 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
Throws:
java.sql.SQLException

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 made
password - the user's password
Returns:
a Connection to the database
Throws:
java.sql.SQLException

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:
systemDatabase - 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

i-net JDBC drivers for MS SQL Server


copyright by i-net software