i-net JDBC drivers for MS SQL Server

com.inet.tds
Class TdsDataSource

java.lang.Object
  extended by com.inet.tds.TdsDriver
      extended by com.inet.tds.TdsDataSource
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
Direct Known Subclasses:
DTCDataSource, PDataSource

public class TdsDataSource
extends com.inet.tds.TdsDriver
implements javax.sql.DataSource, java.io.Serializable, java.lang.Cloneable, javax.naming.Referenceable

This class is an implementation of a simple javax.sql.DataSource for the driver i-net OPTA-xs and MERLIA-xs. For application servers you should use the PDataSource or DTCDataSource.

See Also:
Serialized Form

Field Summary
static int MODE_SQLSERVER_65
          SQL Server 6.5 compatible mode.
static int MODE_SQLSERVER_70
          SQL Server 7.0 or higher mode.
static int MODE_SQLSERVER_70_ASCII
          SQL Server 7.0 ASCII or higher mode.
 
Constructor Summary
TdsDataSource()
          Attempt to create a Datasource.
TdsDataSource(java.util.Properties info)
          Attempt to create a Datasource with the given properties.
 
Method Summary
 java.lang.Object clone()
          Create a new object of the same class like this DataSource.
 boolean equals(java.lang.Object obj)
          Compare this DataSource to the specified object.
 java.lang.String getAppname()
          Return the Application Name.
 java.lang.String getCharset()
          Return the charset for the connection.
 java.sql.Connection getConnection()
          Attempt to establish a connection to the database.
 java.sql.Connection getConnection(java.lang.String username, java.lang.String password)
          Attempt to establish a connection to the database.
 java.lang.String getDatabaseName()
          Return the first database name of the connection after login.
 java.lang.String getDescription()
          Return a one line description of the DataSource.
 boolean getDstsave()
          Returns the value of property dstsave.
 boolean getFailover()
          Returns the value of the property failover.
 java.lang.String getFailoverInstanceName()
          Return the failover instance name of the MS SQL Server.
 java.lang.String getFailoverPort()
          Return the failover TCP/IP port number of the MS SQL Server.
 java.lang.String getFailoverServerName()
          Return the failover server name of the MS SQL Server.
 int getFetchsize()
          Returns the value of the property fetchsize.
 boolean getFulltran()
          Get the transaction mode of the driver.
 boolean getImpltran()
          Get the implicit transaction mode of the driver.
 java.lang.String getInitSQL()
          Get the init SQL expresion.
 java.lang.String getInstanceName()
          Return the instance name of the MS SQL Server.
 boolean getJAVA_OBJECT()
          Returns the value of the property JAVA_OBJECT.
 java.lang.String getLanguage()
          Returns the language, in which the error messages from MS SQL Server will be received.
 java.lang.String getLastUpdateCount()
          Get value of the property lastUpdateCount.
 int getLoginTimeout()
          Returns the timeout for login.
 java.io.PrintWriter getLogWriter()
           
 int getMode()
          Get the protocol mode of the driver.
 java.lang.String getPacketSize()
          Get the network packet size.
 java.lang.String getPassword()
          Return the password for the connection.
 java.lang.String getPort()
          Return the TCP/IP port number of the MS SQL Server.
 int getPortNumber()
          Return the TCP/IP port number of the MS SQL Server.
 boolean getPrepare()
          Returns the property prepare.
 int getPrepareLiveTime()
          Returns the value of the property prepareLiveTime.
 java.util.Properties getProperties()
          Get all properties of the DataSource without LoginTimeout and LogWriter.
 java.lang.String getProperty(java.lang.String propertyName)
          Get any property of the DataSource without LoginTimeout and LogWriter.
 int getQueryTimeout()
          Returns the default query timeout for all statements.
 javax.naming.Reference getReference()
           
 int getResultSetType()
          Get the option resultSetType of the driver.
 java.lang.String getSecureLevel()
          Return the secureLevel for the connection.
 java.lang.String getServerName()
          Return the server name of the MS SQL Server.
 boolean getSqlServer7Mode()
          Deprecated. See setMode
 java.lang.String getStatusRequest()
          Get the status request mode.
 java.lang.String getUrl()
          Get the value that was set with setUrl(String).
 boolean getUseCursorsAlways()
          Get the flag useCursorsAlways of the driver.
 boolean getUseInsteadOfTrigger()
          Returns the value of the property useInsteadOfTrigger.
 java.lang.String getUser()
          Return the user for the connection.
 java.lang.String getWSID()
          Return the Workstation ID.
 boolean isMars()
          Returne whether the MARS mode is enabled or not.
 void setAppname(java.lang.String appname)
          Set the Application Name.
 void setCharset(java.lang.String charset)
          Set the charset for the connection.
 void setDatabaseName(java.lang.String databaseName)
          Set the first database name of the connection after login.
 void setDescription(java.lang.String description)
          Set the description of the DataSource.
 void setDstsave(boolean dstSafe)
          Sets the property dstsave.
 void setFailover(boolean failover)
          Sets the property failover.
 void setFailoverInstanceName(java.lang.String serverName)
          Set the failover instance name of the MS SQL Server.
 void setFailoverPort(java.lang.String port)
          Set the failover TCP/IP port number of the MS SQL Server.
 void setFailoverServerName(java.lang.String serverName)
          Set the failover server name of the MS SQL Server.
 void setFetchsize(int fetchsize)
          Sets the value for the property fetchsize.
 void setFulltran(boolean fulltran)
          Set the transaction mode.
 void setFulltran(java.lang.String fulltran)
          Set the transaction mode.
 void setImpltran(boolean impltran)
          Set the implicit transaction mode.
 void setImpltran(java.lang.String impltran)
          Set the implicit transaction mode.
 void setInitSQL(java.lang.String initSQL)
          Set the init SQL expresion.
 void setInstanceName(java.lang.String serverName)
          Set the instance name of the MS SQL Server.
 void setJAVA_OBJECT(boolean JAVA_OBJECT)
          Sets the value of the property JAVA_OBJECT.
 void setLanguage(java.lang.String language)
          Sets the language of the error messages from MS SQL Server.
 void setLastUpdateCount(java.lang.String LastUpdateCount)
          Set value of the property lastUpdateCount.
 void setLogging(java.lang.String logging)
          Enable the logging of the driver to System.out.
 void setLoginTimeout(int seconds)
          Set the login timeout for the connection.
 void setLogWriter(java.io.PrintWriter out)
           
 void setMars(boolean enable)
          Enables or disables the MARS mode (multiple active resultsets).
 void setMode(int mode)
          Set the protocol mode of the driver.
 void setPacketSize(java.lang.String packetSize)
          Set the network packet size.
 void setPassword(java.lang.String password)
          Set the password for the connection.
 void setPort(java.lang.String port)
          Set TCP/IP port number of the MS SQL Server.
 void setPortNumber(int portNumber)
          Set TCP/IP port number of the MS SQL Server.
 void setPrepare(boolean prepare)
          Sets the property prepare.
 void setPrepareLiveTime(int seconds)
          Set the time in seconds that an unused PreparedStatement handle is live before it is unprepared.
 void setProperties(java.util.Properties properties)
          Set all properties of the DataSource without LoginTimeout and LogWriter.
 void setProperty(java.lang.String keyValuePair)
          Set any property of the datasource.
 void setProperty(java.lang.String name, java.lang.Object value)
          Set any property of the DataSource without LogWriter.
 void setProperty(java.lang.String name, java.lang.String value)
          Set any property of the DataSource without LogWriter.
 void setQueryTimeout(int seconds)
          Set the default query timeout for all statements.
 void setResultSetType(int resultSetType)
          Set the option resultSetType of the driver.
 void setSecureLevel(java.lang.String secureLevel)
          Set the secureLevel for the connection.
 void setServerName(java.lang.String serverName)
          Set the server name of the MS SQL Server.
 void setSqlServer7Mode(boolean mode)
          Deprecated. See setMode
 void setStatusRequest(java.lang.String requestType)
          Set the mode with which the API requests the status of a connection.
 void setUrl(java.lang.String jdbcUrl)
          Set multiple properties with the JDBC URL syntax.
 void setUseCursorsAlways(boolean mode)
          Set the flag useCursorsAlways of the driver.
 void setUseInsteadOfTrigger(boolean useInsteadOfTrigger)
          Sets the property useInsteadOfTrigger.
 void setUser(java.lang.String user)
          Set the user account for the connection.
 void setWSID(java.lang.String wsid)
          Set the Workstation ID.
 java.lang.String 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 java.sql.Wrapper
isWrapperFor, unwrap
 

Field Detail

MODE_SQLSERVER_65

public static final int MODE_SQLSERVER_65
SQL Server 6.5 compatible mode. This is equals to the JDBC subprotocol inetdae6. In config files you can use the value 65.

See Also:
Constant Field Values

MODE_SQLSERVER_70

public static final int MODE_SQLSERVER_70
SQL Server 7.0 or higher mode. This is equals to the JDBC subprotocol inetdae7. The driver uses the unicode data types nXXX in PreparedStatements. In config files you can use the value 70.

See Also:
Constant Field Values

MODE_SQLSERVER_70_ASCII

public static final int MODE_SQLSERVER_70_ASCII
SQL Server 7.0 ASCII or higher mode. This is equals to the JDBC subprotocol inetdae7. The driver uses the ASCII data types varchar, char and text in PreparedStatements. In config files you can use the value 71.

See Also:
Constant Field Values
Constructor Detail

TdsDataSource

public TdsDataSource()
Attempt to create a Datasource. The default mode is to connect to the MS SQL Server 7 or higher.


TdsDataSource

public TdsDataSource(java.util.Properties info)
              throws java.sql.SQLException
Attempt to create a Datasource with the given properties.

Parameters:
info - a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
Throws:
java.sql.SQLException
Method Detail

getConnection

public java.sql.Connection getConnection()
                                  throws java.sql.SQLException
Attempt to establish a connection to the database.

Specified by:
getConnection in interface javax.sql.DataSource
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
Attempt to establish a connection to the database.

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

setUrl

public void setUrl(java.lang.String jdbcUrl)
            throws java.sql.SQLException
Set multiple properties with the JDBC URL syntax. It is not possible to request an resulting URL string from the current properties.

Parameters:
jdbcUrl - a valid JDBC URL string
Throws:
java.sql.SQLException - if the syntax of the URL is incorrectly.
Since:
7.04

getUrl

public java.lang.String getUrl()
Get the value that was set with setUrl(String).

Returns:
the JDBC URL or null
Since:
7.04
See Also:
setUrl(String)

getServerName

public java.lang.String getServerName()
Return the server name of the MS SQL Server.

Returns:
the host name or IP-Address. If not set the value is null.

setServerName

public void setServerName(java.lang.String serverName)
Set the server name of the MS SQL Server.

Parameters:
serverName - the host name or IP-Address.

getInstanceName

public java.lang.String getInstanceName()
Return the instance name of the MS SQL Server. This is a feature of the SQL Server 2000 or higher.

Returns:
instance name.
Since:
4.14

setInstanceName

public void setInstanceName(java.lang.String serverName)
Set the instance name of the MS SQL Server. This is a feature of the SQL Server 2000 or higher.

Parameters:
serverName - the instance name.
Since:
4.14

getDatabaseName

public java.lang.String getDatabaseName()
Return the first database name of the connection after login. If not set the user default database is used.

Returns:
the name of database. If not set the value is null.

setDatabaseName

public void setDatabaseName(java.lang.String databaseName)
Set the first database name of the connection after login.

Parameters:
databaseName - the name of database.

getDescription

public java.lang.String getDescription()
Return a one line description of the DataSource.

Returns:
the description. If not set the value is null.

setDescription

public void setDescription(java.lang.String description)
Set the description of the DataSource.

Parameters:
description - a one line description.

getAppname

public java.lang.String getAppname()
Return the Application Name.

Returns:
the appname. If not set the value is null.

setAppname

public void setAppname(java.lang.String appname)
Set the Application Name. This has only an effect for the Enterprice and OEM license

Parameters:
appname - a one line description.

getWSID

public java.lang.String getWSID()
Return the Workstation ID.

Returns:
the Workstation ID. If not set the value is the host name of the local computer.
See Also:
setWSID(java.lang.String)

setWSID

public void setWSID(java.lang.String wsid)
Set the Workstation ID. With the WSID you can set the return value of the transact SQL method HOST_NAME().

Parameters:
wsid - a one line description.
See Also:
getWSID()

getPortNumber

public int getPortNumber()
Return the TCP/IP port number of the MS SQL Server.

Returns:
the port number. If not set the value is 1433.

getPort

public java.lang.String getPort()
Return the TCP/IP port number of the MS SQL Server.

Returns:
the port number. If not set the value will be 1433.

setPortNumber

public void setPortNumber(int portNumber)
Set TCP/IP port number of the MS SQL Server. If not set the default value of 1433 will be used.

Parameters:
portNumber - the port number.

setPort

public void setPort(java.lang.String port)
Set TCP/IP port number of the MS SQL Server. If not set the default value of 1433 will be used.

Parameters:
port - the port number.

getPassword

public java.lang.String getPassword()
Return the password for the connection.

Returns:
the password. If not set the value is null.

setPassword

public void setPassword(java.lang.String password)
Set the password for the connection. If not set an empty password is used. It must be the password of a MS SQL Server login and not the password of a NT Account.

Parameters:
password - the password for the MS SQL Server.

getUser

public java.lang.String getUser()
Return the user for the connection.

Returns:
the user. If not set the value is null.

setUser

public void setUser(java.lang.String user)
Set the user account for the connection. This account must be set. It must be a user name of a MS SQL Server login and not the user name of a NT Account.

Parameters:
user - the user for the MS SQL Server.

getSecureLevel

public java.lang.String getSecureLevel()
Return the secureLevel for the connection.

Returns:
the secureLevel. If not set the value is 1.

setSecureLevel

public void setSecureLevel(java.lang.String secureLevel)
Set the secureLevel for the connection. For more infos see in the documention of the driver.

Parameters:
secureLevel - the secureLevel for the connection.

getCharset

public java.lang.String getCharset()
Return the charset for the connection.

Returns:
the charset. If not set the value is null.

setCharset

public void setCharset(java.lang.String charset)
Set the charset for the connection.

Parameters:
charset - the charset for the MS SQL Server.

getLogWriter

public java.io.PrintWriter getLogWriter()
Specified by:
getLogWriter in interface javax.sql.CommonDataSource
Overrides:
getLogWriter in class com.inet.tds.TdsDriver

setLogWriter

public void setLogWriter(java.io.PrintWriter out)
Specified by:
setLogWriter in interface javax.sql.CommonDataSource

getLoginTimeout

public int getLoginTimeout()
Returns the timeout for login.

Specified by:
getLoginTimeout in interface javax.sql.CommonDataSource
Returns:
the login timeout. If not set the value is 0.

setLoginTimeout

public void setLoginTimeout(int seconds)
Set the login timeout for the connection. This timeout * 5 is also the default query timeout for all statements.

Specified by:
setLoginTimeout in interface javax.sql.CommonDataSource
Parameters:
seconds - the login timeout for the connection.

getQueryTimeout

public int getQueryTimeout()
Returns the default query timeout for all statements.

Returns:
the query timeout. If not set the value is 0.

setQueryTimeout

public void setQueryTimeout(int seconds)
Set the default query timeout for all statements.

Parameters:
seconds - the query timeout

setLanguage

public void setLanguage(java.lang.String language)
Sets the language of the error messages from MS SQL Server. Default is the language configuration of the MS SQL Server.

Parameters:
language - the language of the error messages from MS SQL Server.

getLanguage

public java.lang.String getLanguage()
Returns the language, in which the error messages from MS SQL Server will be received.

Returns:
the language, in which the error messages from MS SQL Server will be received.

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
Set any property of the DataSource without LogWriter.

Parameters:
name - The name of the property.
value - The value of the property.
See Also:
getProperty(String), getProperties()

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
Set any property of the DataSource without LogWriter. This method was used from WebLogic Server

Parameters:
name - The name of the property.
value - The value of the property.
See Also:
getProperty(String), getProperties()

getProperty

public java.lang.String getProperty(java.lang.String propertyName)
Get any property of the DataSource without LoginTimeout and LogWriter.

Parameters:
propertyName - The name of the property.
Returns:
value The value of the property.
See Also:
setProperty(String,String), getProperties()

setProperties

public void setProperties(java.util.Properties properties)
Set all properties of the DataSource without LoginTimeout and LogWriter.

Parameters:
properties - All properties of the DataSource without LoginTimeout and LogWriter
See Also:
getProperty(String), getProperties()

getProperties

public java.util.Properties getProperties()
Get all properties of the DataSource without LoginTimeout and LogWriter.

Returns:
value The value of the property.
See Also:
setProperty(String,String), getProperty(String)

setMode

public void setMode(int mode)
Set the protocol mode of the driver. The default value is MODE_SQLSERVER_70.
With the value MODE_SQLSERVER_65 you can connect to all SQL Server versions.
With the value MODE_SQLSERVER_70 you can only connect to SQL Server 7.0 or higher.

Parameters:
mode - the protocol mode
See Also:
getMode(), MODE_SQLSERVER_65, MODE_SQLSERVER_70, MODE_SQLSERVER_70_ASCII

getMode

public int getMode()
Get the protocol mode of the driver.

Returns:
the protocol mode
See Also:
setMode(int), MODE_SQLSERVER_65, MODE_SQLSERVER_70, MODE_SQLSERVER_70_ASCII

setImpltran

public void setImpltran(java.lang.String impltran)
Set the implicit transaction mode. If the value is true then the method setTransactionIsolation() will call setAutoCommit( false ) implicitly and start a transaction.

Parameters:
impltran - the implicit transaction mode
See Also:
getImpltran()

setLogging

public void setLogging(java.lang.String logging)
Enable the logging of the driver to System.out.

Parameters:
logging - true if the driver should print log messages to System.out.

setProperty

public void setProperty(java.lang.String keyValuePair)
Set any property of the datasource. The set String must have the following structure:
key=value
An example:
"user=scott"

Parameters:
keyValuePair - the property to be set

setImpltran

public void setImpltran(boolean impltran)
Set the implicit transaction mode. If the value is true then the method setTransactionIsolation() will call setAutoCommit( false ) implicitly and start a transaction.

Parameters:
impltran - the implicit transaction mode
See Also:
getImpltran()

getImpltran

public boolean getImpltran()
Get the implicit transaction mode of the driver.

Returns:
the implicit transaction mode
See Also:
setImpltran(boolean)

setFulltran

public void setFulltran(java.lang.String fulltran)
Set the transaction mode. With the option fulltran=true the method setAutoCommit() uses "BEGIN TRAN" and "COMMIT TRAN". If the flag auto commit is set then there will always be a running transaction.

With fulltran=false the method setAutoCommit() uses "SET IMPLICIT_TRANSACTIONS ON" and "SET IMPLICIT_TRANSACTIONS OFF". If the flag auto commit is set then the transactions will only start if needed.

More information on these SQL expressions and their behaviour can be found in the MS SQL Server Online Manual.

Parameters:
fulltran - the transaction mode
See Also:
getFulltran()

setFulltran

public void setFulltran(boolean fulltran)
Set the transaction mode. With the option fulltran=true the method setAutoCommit() uses "BEGIN TRAN" and "COMMIT TRAN". If the flag auto commit is set then there will always be a running transaction.

With fulltran=false the method setAutoCommit() uses "SET IMPLICIT_TRANSACTIONS ON" and "SET IMPLICIT_TRANSACTIONS OFF". If the flag auto commit is set then the transactions will only start if needed.

More information on these SQL expressions and their behaviour can be found in the MS SQL Server Online Manual.

Parameters:
fulltran - the transaction mode
See Also:
getFulltran()

getFulltran

public boolean getFulltran()
Get the transaction mode of the driver.

Returns:
the transaction mode
See Also:
setFulltran(boolean)

setSqlServer7Mode

public void setSqlServer7Mode(boolean mode)
Deprecated. See setMode

Set the protocol mode of the driver. The default value is true. With the value false you can connect to all SQL Server versions. With the value true you can only connect to SQL Server 7.0 or higher.

Parameters:
mode - the protocol mode
See Also:
getSqlServer7Mode(), setMode(int)

getSqlServer7Mode

public boolean getSqlServer7Mode()
Deprecated. See setMode

Get the protocol mode of the driver.

Returns:
the protocol mode
See Also:
setSqlServer7Mode(boolean)

setUseCursorsAlways

public void setUseCursorsAlways(boolean mode)
Set the flag useCursorsAlways of the driver.

See Also:
getUseCursorsAlways()

getUseCursorsAlways

public boolean getUseCursorsAlways()
Get the flag useCursorsAlways of the driver.

Returns:
the flag useCursorsAlways
See Also:
setUseCursorsAlways(boolean)

setResultSetType

public void setResultSetType(int resultSetType)
Set the option resultSetType of the driver.

See Also:
getResultSetType()

getResultSetType

public int getResultSetType()
Get the option resultSetType of the driver.

Returns:
the option resultSetType
See Also:
setResultSetType(int)

setInitSQL

public void setInitSQL(java.lang.String initSQL)
Set the init SQL expresion. This expression is executed once per connection.

See Also:
getInitSQL()

getInitSQL

public java.lang.String getInitSQL()
Get the init SQL expresion.

See Also:
setInitSQL(java.lang.String)

setLastUpdateCount

public void setLastUpdateCount(java.lang.String LastUpdateCount)
Set value of the property lastUpdateCount.

See Also:
getLastUpdateCount()

getLastUpdateCount

public java.lang.String getLastUpdateCount()
Get value of the property lastUpdateCount.

See Also:
setLastUpdateCount(java.lang.String)

setPrepare

public void setPrepare(boolean prepare)
Sets the property prepare. If set on true(default), PreparedStatements are prepared on the SQL Server. If set on false, the driver sends for every call of execute() all data.

Parameters:
prepare - the property prepare
See Also:
getPrepare()

getPrepare

public boolean getPrepare()
Returns the property prepare.

Returns:
the property prepare
See Also:
setPrepare(boolean)

setPrepareLiveTime

public void setPrepareLiveTime(int seconds)
Set the time in seconds that an unused PreparedStatement handle is live before it is unprepared. A value of 0 means an unlimited live time. Default is 60.

Parameters:
seconds - the time in seconds that an unused PreparedStatement handle is live before it is unprepared.
See Also:
getPrepareLiveTime()

getPrepareLiveTime

public int getPrepareLiveTime()
Returns the value of the property prepareLiveTime.

Returns:
the value of the property prepareLiveTime.
See Also:
setPrepareLiveTime(int)

setJAVA_OBJECT

public void setJAVA_OBJECT(boolean JAVA_OBJECT)
Sets the value of the property JAVA_OBJECT. The default value is true.
The method getObject() converts valid Java serialized data in IMAGE columns to a Java Object. This is required to implement the type JAVA_OBJECT but it can be fatal if you implement your own Object serialization. If you use your own Java serialization then the best solution is to use getBytes() and not getObject().

Parameters:
JAVA_OBJECT -
See Also:
getJAVA_OBJECT()

getJAVA_OBJECT

public boolean getJAVA_OBJECT()
Returns the value of the property JAVA_OBJECT.

Returns:
the value of the property JAVA_OBJECT.
See Also:
setJAVA_OBJECT(boolean)

setUseInsteadOfTrigger

public void setUseInsteadOfTrigger(boolean useInsteadOfTrigger)
Sets the property useInsteadOfTrigger. Default is false. On true : in a query with multiple tables all are updated in one step with updateRow(). You need a INSTEAD OF trigger.

Parameters:
useInsteadOfTrigger - the property value for the property useInsteadOfTrigger.
See Also:
getUseInsteadOfTrigger()

getUseInsteadOfTrigger

public boolean getUseInsteadOfTrigger()
Returns the value of the property useInsteadOfTrigger.

Returns:
the value of the property useInsteadOfTrigger.
See Also:
setUseInsteadOfTrigger(boolean)

setFetchsize

public void setFetchsize(int fetchsize)
Sets the value for the property fetchsize. This value will only read for the UNA driver. the method executeQuery() always uses server cursors with this fetch size. The other drivers can use Statement.setFetchSize() The default value is 0, which means to fetch all rows at once.

Parameters:
fetchsize - the value for the property fetchsize.

getFetchsize

public int getFetchsize()
Returns the value of the property fetchsize.

Returns:
the value of the property fetchsize.

setFailover

public void setFailover(boolean failover)
Sets the property failover. The default value is false. Please have a look in the manual.html chapter "Failover on getConnection" for more informations.

Parameters:
failover -
See Also:
getFailover(), setFailoverServerName(String), setFailoverInstanceName(String), setFailoverPort(String)

getFailover

public boolean getFailover()
Returns the value of the property failover.

Returns:
the value of the property failover.
See Also:
setFailover(boolean)

getFailoverServerName

public java.lang.String getFailoverServerName()
Return the failover server name of the MS SQL Server.

Returns:
the failover host name or IP-Address. If not set the value of the default configuration is used.
Since:
6.09

setFailoverServerName

public void setFailoverServerName(java.lang.String serverName)
Set the failover server name of the MS SQL Server. Please have a look in the manual.html chapter "Failover on getConnection" for more informations.

Parameters:
serverName - the host name or IP-Address.
Since:
6.09
See Also:
setFailover(boolean)

getFailoverInstanceName

public java.lang.String getFailoverInstanceName()
Return the failover instance name of the MS SQL Server. This is a feature of the SQL Server 2000 or higher.

Returns:
instance name.
Since:
6.09

setFailoverInstanceName

public void setFailoverInstanceName(java.lang.String serverName)
Set the failover instance name of the MS SQL Server. This is a feature of the SQL Server 2000 or higher.

Parameters:
serverName - the instance name.
Since:
6.09
See Also:
setFailover(boolean)

getFailoverPort

public java.lang.String getFailoverPort()
Return the failover TCP/IP port number of the MS SQL Server.

Returns:
the port number. If not set the value of the default configuration is used.
Since:
6.09

setFailoverPort

public void setFailoverPort(java.lang.String port)
Set the failover TCP/IP port number of the MS SQL Server. If not set the value of the default configuration is used.

Parameters:
port - the port number.
Since:
6.09
See Also:
setFailover(boolean)

setDstsave

public void setDstsave(boolean dstSafe)
Sets the property dstsave.
It effects the way timezone offset is calculated. The ways differ in speed and safety. If true the slower way is used, but this way is bug free. If false, the faster way is used (2-3 times faster), but this way has a Java bug for some time zones at the day the day saving time switches. The bug there is a time displacement of one hour for some hours of the day.

Parameters:
dstSafe - the value of property dstsave.
Since:
6.05.01
See Also:
getDstsave()

getDstsave

public boolean getDstsave()
Returns the value of property dstsave.

Returns:
the value of property dstsave.
Since:
6.05.01
See Also:
setDstsave(boolean)

setMars

public void setMars(boolean enable)
Enables or disables the MARS mode (multiple active resultsets). If enabled not the whole ResultSet will be requested from the database server. The missing data will be requested if needed.
Note: This property is available for SQL Server 2005 only.

Parameters:
enable - True to enable and false to disable the MARS mode.
Since:
6.07.03
See Also:
isMars()

isMars

public boolean isMars()
Returne whether the MARS mode is enabled or not.
Note: This property is available for SQL Server 2005 only.

Returns:
True if the MARS mode is enabled false otherwise.
Since:
6.07.03
See Also:
setMars(boolean)

setStatusRequest

public void setStatusRequest(java.lang.String requestType)
Set the mode with which the API requests the status of a connection. There are 2 possible modes:

Parameters:
requestType -
See Also:
getStatusRequest()

getStatusRequest

public java.lang.String getStatusRequest()
Get the status request mode.

Returns:
the current or default value.
See Also:
setStatusRequest(String)

setPacketSize

public void setPacketSize(java.lang.String packetSize)
Set the network packet size. The default value is 8000. The value can be between 512 and 32767 or 0. A value of 0 means to use the server default value which is by default 4096.

Parameters:
packetSize - the new value

getPacketSize

public java.lang.String getPacketSize()
Get the network packet size.

Returns:
the current value

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Create a new object of the same class like this DataSource.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance.
Throws:
java.lang.CloneNotSupportedException

equals

public boolean equals(java.lang.Object obj)
Compare this DataSource to the specified object. The result is true if and only if the argument is not null and is a TdsDataSource object that has the same significant properties.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare.

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

i-net JDBC drivers for MS SQL Server


copyright by i-net software