|
i-net JDBC drivers for MS SQL Server | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.inet.tds.TdsDriver com.inet.tds.TdsDataSource
public class TdsDataSource
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.
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 |
---|
public static final int MODE_SQLSERVER_65
public static final int MODE_SQLSERVER_70
public static final int MODE_SQLSERVER_70_ASCII
Constructor Detail |
---|
public TdsDataSource()
public TdsDataSource(java.util.Properties info) throws java.sql.SQLException
info
- a list of arbitrary string tag/value pairs as connection arguments; normally at least a "user" and "password" property should be included
java.sql.SQLException
Method Detail |
---|
public java.sql.Connection getConnection() throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
java.sql.SQLException
public java.sql.Connection getConnection(java.lang.String username, java.lang.String password) throws java.sql.SQLException
getConnection
in interface javax.sql.DataSource
username
- the database user on whose behalf the Connection is being made.password
- the user's password.
java.sql.SQLException
public void setUrl(java.lang.String jdbcUrl) throws java.sql.SQLException
jdbcUrl
- a valid JDBC URL string
java.sql.SQLException
- if the syntax of the URL is incorrectly.public java.lang.String getUrl()
setUrl(String)
public java.lang.String getServerName()
public void setServerName(java.lang.String serverName)
serverName
- the host name or IP-Address.public java.lang.String getInstanceName()
public void setInstanceName(java.lang.String serverName)
serverName
- the instance name.public java.lang.String getDatabaseName()
public void setDatabaseName(java.lang.String databaseName)
databaseName
- the name of database.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- a one line description.public java.lang.String getAppname()
public void setAppname(java.lang.String appname)
appname
- a one line description.public java.lang.String getWSID()
setWSID(java.lang.String)
public void setWSID(java.lang.String wsid)
wsid
- a one line description.getWSID()
public int getPortNumber()
public java.lang.String getPort()
public void setPortNumber(int portNumber)
portNumber
- the port number.public void setPort(java.lang.String port)
port
- the port number.public java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password for the MS SQL Server.public java.lang.String getUser()
public void setUser(java.lang.String user)
user
- the user for the MS SQL Server.public java.lang.String getSecureLevel()
public void setSecureLevel(java.lang.String secureLevel)
secureLevel
- the secureLevel for the connection.public java.lang.String getCharset()
public void setCharset(java.lang.String charset)
charset
- the charset for the MS SQL Server.public java.io.PrintWriter getLogWriter()
getLogWriter
in interface javax.sql.CommonDataSource
getLogWriter
in class com.inet.tds.TdsDriver
public void setLogWriter(java.io.PrintWriter out)
setLogWriter
in interface javax.sql.CommonDataSource
public int getLoginTimeout()
getLoginTimeout
in interface javax.sql.CommonDataSource
public void setLoginTimeout(int seconds)
setLoginTimeout
in interface javax.sql.CommonDataSource
seconds
- the login timeout for the connection.public int getQueryTimeout()
public void setQueryTimeout(int seconds)
seconds
- the query timeoutpublic void setLanguage(java.lang.String language)
language
- the language of the error messages from MS SQL Server.public java.lang.String getLanguage()
public void setProperty(java.lang.String name, java.lang.String value)
name
- The name of the property.value
- The value of the property.getProperty(String)
,
getProperties()
public void setProperty(java.lang.String name, java.lang.Object value)
name
- The name of the property.value
- The value of the property.getProperty(String)
,
getProperties()
public java.lang.String getProperty(java.lang.String propertyName)
propertyName
- The name of the property.
setProperty(String,String)
,
getProperties()
public void setProperties(java.util.Properties properties)
properties
- All properties of the DataSource
without LoginTimeout and LogWritergetProperty(String)
,
getProperties()
public java.util.Properties getProperties()
setProperty(String,String)
,
getProperty(String)
public void setMode(int mode)
mode
- the protocol modegetMode()
,
MODE_SQLSERVER_65
,
MODE_SQLSERVER_70
,
MODE_SQLSERVER_70_ASCII
public int getMode()
setMode(int)
,
MODE_SQLSERVER_65
,
MODE_SQLSERVER_70
,
MODE_SQLSERVER_70_ASCII
public void setImpltran(java.lang.String impltran)
impltran
- the implicit transaction modegetImpltran()
public void setLogging(java.lang.String logging)
logging
- true if the driver should print log messages to System.out.public void setProperty(java.lang.String keyValuePair)
key=value
keyValuePair
- the property to be setpublic void setImpltran(boolean impltran)
impltran
- the implicit transaction modegetImpltran()
public boolean getImpltran()
setImpltran(boolean)
public void setFulltran(java.lang.String fulltran)
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.
fulltran
- the transaction modegetFulltran()
public void setFulltran(boolean fulltran)
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.
fulltran
- the transaction modegetFulltran()
public boolean getFulltran()
setFulltran(boolean)
public void setSqlServer7Mode(boolean mode)
mode
- the protocol modegetSqlServer7Mode()
,
setMode(int)
public boolean getSqlServer7Mode()
setSqlServer7Mode(boolean)
public void setUseCursorsAlways(boolean mode)
getUseCursorsAlways()
public boolean getUseCursorsAlways()
setUseCursorsAlways(boolean)
public void setResultSetType(int resultSetType)
getResultSetType()
public int getResultSetType()
setResultSetType(int)
public void setInitSQL(java.lang.String initSQL)
getInitSQL()
public java.lang.String getInitSQL()
setInitSQL(java.lang.String)
public void setLastUpdateCount(java.lang.String LastUpdateCount)
getLastUpdateCount()
public java.lang.String getLastUpdateCount()
setLastUpdateCount(java.lang.String)
public void setPrepare(boolean prepare)
true
(default), PreparedStatements are prepared on the SQL Server.
If set on false, the driver sends for every call of execute() all data.
prepare
- the property preparegetPrepare()
public boolean getPrepare()
setPrepare(boolean)
public void setPrepareLiveTime(int seconds)
seconds
- the time in seconds that an unused PreparedStatement handle is live before it is unprepared.getPrepareLiveTime()
public int getPrepareLiveTime()
setPrepareLiveTime(int)
public void setJAVA_OBJECT(boolean JAVA_OBJECT)
JAVA_OBJECT
- getJAVA_OBJECT()
public boolean getJAVA_OBJECT()
setJAVA_OBJECT(boolean)
public void setUseInsteadOfTrigger(boolean useInsteadOfTrigger)
useInsteadOfTrigger
- the property value for the property useInsteadOfTrigger.getUseInsteadOfTrigger()
public boolean getUseInsteadOfTrigger()
setUseInsteadOfTrigger(boolean)
public void setFetchsize(int fetchsize)
fetchsize
- the value for the property fetchsize.public int getFetchsize()
public void setFailover(boolean failover)
failover
- getFailover()
,
setFailoverServerName(String)
,
setFailoverInstanceName(String)
,
setFailoverPort(String)
public boolean getFailover()
setFailover(boolean)
public java.lang.String getFailoverServerName()
public void setFailoverServerName(java.lang.String serverName)
serverName
- the host name or IP-Address.setFailover(boolean)
public java.lang.String getFailoverInstanceName()
public void setFailoverInstanceName(java.lang.String serverName)
serverName
- the instance name.setFailover(boolean)
public java.lang.String getFailoverPort()
public void setFailoverPort(java.lang.String port)
port
- the port number.setFailover(boolean)
public void setDstsave(boolean dstSafe)
dstSafe
- the value of property dstsave.getDstsave()
public boolean getDstsave()
setDstsave(boolean)
public void setMars(boolean enable)
enable
- True
to enable and false
to disable
the MARS mode.isMars()
public boolean isMars()
True
if the MARS mode is enabled false
otherwise.setMars(boolean)
public void setStatusRequest(java.lang.String requestType)
requestType
- getStatusRequest()
public java.lang.String getStatusRequest()
setStatusRequest(String)
public void setPacketSize(java.lang.String packetSize)
packetSize
- the new valuepublic java.lang.String getPacketSize()
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare.public javax.naming.Reference getReference() throws javax.naming.NamingException
getReference
in interface javax.naming.Referenceable
javax.naming.NamingException
public java.lang.String toString()
toString
in class java.lang.Object
|
i-net JDBC drivers for MS SQL Server | |||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |