ASYNC_CANCEL
private static final int ASYNC_CANCEL
Cancel has been generated by Statement.cancel()
.
CANCEL_PKT
public static final byte CANCEL_PKT
TDS Cancel packet.
DEFAULT_MIN_PKT_SIZE_TDS70
public static final int DEFAULT_MIN_PKT_SIZE_TDS70
Default minimum network packet size for TDS 7.0 and newer.
DONE_CANCEL
(package private) static final byte DONE_CANCEL
Done: Cancel acknowledgement.
DONE_END_OF_RESPONSE
private static final byte DONE_END_OF_RESPONSE
Done: Response terminator (if more than one request packet is sent, each
response is terminated by a DONE packet with this flag set).
DONE_ERROR
private static final byte DONE_ERROR
Done: command caused an error.
DONE_MORE_RESULTS
private static final byte DONE_MORE_RESULTS
Done: more results are expected.
DONE_ROW_COUNT
private static final byte DONE_ROW_COUNT
Done: There is a valid row count.
EMPTY_PARAMETER_INFO
private static final ParamInfo[] EMPTY_PARAMETER_INFO
EXECUTE_SQL
public static final int EXECUTE_SQL
Prepare SQL using sp_executesql
LOGIN_PKT
public static final byte LOGIN_PKT
TDS 4.2 or 5.0 Login packet.
MAX_PKT_SIZE
public static final int MAX_PKT_SIZE
Maximum network packet size.
MIN_PKT_SIZE
public static final int MIN_PKT_SIZE
Minimum network packet size.
MSDTC_PKT
public static final byte MSDTC_PKT
TDS MSDTC packet.
MSLOGIN_PKT
public static final byte MSLOGIN_PKT
TDS 7.0 Login packet.
NTLMAUTH_PKT
public static final byte NTLMAUTH_PKT
TDS 7.0 NTLM Authentication packet.
PKT_HDR_LEN
public static final int PKT_HDR_LEN
The size of the packet header.
PRELOGIN_PKT
public static final byte PRELOGIN_PKT
SQL 2000 prelogin negotiation packet.
PREPARE
public static final int PREPARE
Prepare SQL using sp_prepare and sp_execute
QUERY_PKT
public static final byte QUERY_PKT
TDS 4.2 or 7.0 Query packet.
REPLY_PKT
public static final byte REPLY_PKT
TDS Reply packet.
RPC_PKT
public static final byte RPC_PKT
TDS Remote Procedure Call.
SSL_CLIENT_FORCE_ENCRYPT
public static final int SSL_CLIENT_FORCE_ENCRYPT
SSL Mode - Client requested force encryption.
SSL_ENCRYPT_LOGIN
public static final int SSL_ENCRYPT_LOGIN
SSL Mode - Login packet must be encrypted.
SSL_NO_ENCRYPT
public static final int SSL_NO_ENCRYPT
SSL Mode - No server certificate installed.
SSL_SERVER_FORCE_ENCRYPT
public static final int SSL_SERVER_FORCE_ENCRYPT
SSL Mode - Server requested force encryption.
SYBQUERY_PKT
public static final byte SYBQUERY_PKT
TDS 5.0 Query packet.
SYB_BIGINT
(package private) static final int SYB_BIGINT
Sybase 15+ bigint.
SYB_BITNULL
(package private) static final int SYB_BITNULL
Sybase nullable bit type.
SYB_DATETIME
(package private) static final int SYB_DATETIME
Sybase date and time data types.
SYB_EXTCOLINFO
(package private) static final int SYB_EXTCOLINFO
Sybase extended column meta data.
SYB_LONGDATA
(package private) static final int SYB_LONGDATA
Sybase char and binary > 255.
SYB_UNICODE
(package private) static final int SYB_UNICODE
Sybase univarchar etc.
SYB_UNITEXT
(package private) static final int SYB_UNITEXT
Sybase 15+ unitext.
TDS5_DYNAMIC_TOKEN
private static final byte TDS5_DYNAMIC_TOKEN
TDS 5.0 Dynamic SQL token.
TDS5_PARAMFMT2_TOKEN
private static final byte TDS5_PARAMFMT2_TOKEN
TDS 5.0 Parameter format token.
TDS5_PARAMFMT_TOKEN
private static final byte TDS5_PARAMFMT_TOKEN
TDS 5.0 parameter descriptor token.
TDS5_PARAMS_TOKEN
private static final byte TDS5_PARAMS_TOKEN
TDS 5.0 parameter value token.
TDS5_WIDE_RESULT
private static final byte TDS5_WIDE_RESULT
TSD 5.0 Wide result set token.
TDS7_COMP_RESULT_TOKEN
private static final byte TDS7_COMP_RESULT_TOKEN
TDS 7.0 Computed Result set column meta data token.
TDS7_RESULT_TOKEN
private static final byte TDS7_RESULT_TOKEN
TDS 7.0 Result set column meta data token.
TDS_ALTROW
private static final byte TDS_ALTROW
TDS Computed result set data row token.
TDS_AUTH_TOKEN
private static final byte TDS_AUTH_TOKEN
TDS 7.0 NTLM authentication challenge token.
TDS_CAP_TOKEN
private static final byte TDS_CAP_TOKEN
TDS 5.0 capabilities token.
TDS_CLOSE_TOKEN
private static final byte TDS_CLOSE_TOKEN
TDS 5.0 Close token.
TDS_COLFMT_TOKEN
private static final byte TDS_COLFMT_TOKEN
TDS 4.2 Column meta data token.
TDS_COLINFO_TOKEN
private static final byte TDS_COLINFO_TOKEN
TDS Cursor results column infomation token.
TDS_COLNAME_TOKEN
private static final byte TDS_COLNAME_TOKEN
TDS 4.2 Column names token.
TDS_COMP_NAMES_TOKEN
private static final byte TDS_COMP_NAMES_TOKEN
TDS Computed result set names token.
TDS_COMP_RESULT_TOKEN
private static final byte TDS_COMP_RESULT_TOKEN
TDS Computed result set token.
TDS_CONTROL_TOKEN
private static final byte TDS_CONTROL_TOKEN
TDS control token.
TDS_DBRPC_TOKEN
private static final byte TDS_DBRPC_TOKEN
TDS 5.0 RPC token.
TDS_DONEINPROC_TOKEN
private static final byte TDS_DONEINPROC_TOKEN
TDS done in procedure token.
TDS_DONEPROC_TOKEN
private static final byte TDS_DONEPROC_TOKEN
TDS done procedure token.
TDS_DONE_TOKEN
private static final byte TDS_DONE_TOKEN
TDS done token.
TDS_ENVCHANGE_TOKEN
private static final byte TDS_ENVCHANGE_TOKEN
TDS environment change token.
TDS_ENV_CHARSET
private static final byte TDS_ENV_CHARSET
Environment change: charset changed.
TDS_ENV_DATABASE
private static final byte TDS_ENV_DATABASE
Environment change: database changed.
TDS_ENV_LANG
private static final byte TDS_ENV_LANG
Environment change: language changed.
TDS_ENV_LCID
private static final byte TDS_ENV_LCID
Environment change: locale changed.
TDS_ENV_PACKSIZE
private static final byte TDS_ENV_PACKSIZE
Environment change: network packet size changed.
TDS_ENV_SQLCOLLATION
private static final byte TDS_ENV_SQLCOLLATION
Environment change: TDS 8 collation changed.
TDS_ERROR_TOKEN
private static final byte TDS_ERROR_TOKEN
TDS error result token.
TDS_INFO_TOKEN
private static final byte TDS_INFO_TOKEN
TDS Information message token.
TDS_LANG_TOKEN
private static final byte TDS_LANG_TOKEN
TDS 5.0 Language token.
TDS_LOGINACK_TOKEN
private static final byte TDS_LOGINACK_TOKEN
TDS Login acknowledgement token.
TDS_MSG50_TOKEN
private static final byte TDS_MSG50_TOKEN
TDS 5.0 message token.
TDS_OFFSETS_TOKEN
private static final byte TDS_OFFSETS_TOKEN
TDS DBLIB Offsets token.
TDS_OPTIONCMD_TOKEN
private static final byte TDS_OPTIONCMD_TOKEN
TDS Optional command token.
TDS_ORDER_TOKEN
private static final byte TDS_ORDER_TOKEN
TDS Order by columns token.
TDS_PARAM_TOKEN
private static final byte TDS_PARAM_TOKEN
TDS Output parameter value token.
TDS_PROCID
private static final byte TDS_PROCID
TDS Procedure ID token.
TDS_RESULT_TOKEN
private static final byte TDS_RESULT_TOKEN
TDS 5.0 Result set column meta data token.
TDS_RETURNSTATUS_TOKEN
private static final byte TDS_RETURNSTATUS_TOKEN
TDS Procedure call return status token.
TDS_ROW_TOKEN
private static final byte TDS_ROW_TOKEN
TDS Result set data row token.
TDS_TABNAME_TOKEN
private static final byte TDS_TABNAME_TOKEN
TDS Table name token.
TEMPORARY_STORED_PROCEDURES
public static final int TEMPORARY_STORED_PROCEDURES
Prepare SQL using temporary stored procedures
TIMEOUT_CANCEL
private static final int TIMEOUT_CANCEL
Cancel has been generated by a query timeout.
UNPREPARED
public static final int UNPREPARED
Do not prepare SQL
cancelMonitor
private final int[] cancelMonitor
cancelPending
private boolean cancelPending
Indicates pending cancel that needs to be cleared.
columns
private ColInfo[] columns
The array of column meta data objects for this result set.
connection
private final ConnectionJDBC2 connection
The Connection object that created this object.
connectionLock
private Semaphore connectionLock
Mutual exclusion lock on connection.
currentToken
private TdsCore.TdsToken currentToken
The descriptor object for the current TDS token.
endOfResponse
private boolean endOfResponse
True if the server response is fully read.
endOfResults
private boolean endOfResults
True if the current result set is at end of file.
fatalError
private boolean fatalError
Indicates that a fatal error has occured and the connection will close.
hostName
private static String hostName
Name of the client host (it can take quite a while to find it out if DNS is configured incorrectly).
inBatch
private boolean inBatch
Indicates processing a batch.
isClosed
private boolean isClosed
Indicates that this object is closed.
messages
private final SQLDiagnostic messages
The head of the diagnostic messages chain.
nextParam
private int nextParam
The index of the next output parameter to populate.
ntlmAuthSSO
private boolean ntlmAuthSSO
Flag that indicates if logon() should try to use Windows Single Sign On using SSPI.
out
private final RequestStream out
The output server request stream.
parameters
private ParamInfo[] parameters
The array of parameter meta data objects for the current procedure call.
returnParam
private ParamInfo returnParam
The return parameter meta data object for the current procedure call.
returnStatus
private Integer returnStatus
The stored procedure return status.
rowData
private Object[] rowData
The array of column data objects in the current row.
serverType
private final int serverType
The make of SQL Server (Sybase/Microsoft).
socket
private final SharedSocket socket
The Shared network socket object.
sslMode
private int sslMode
Indicates type of SSL connection.
sspiJNIClient
private static SSPIJNIClient sspiJNIClient
A reference to ntlm.SSPIJNIClient.
tds8SpNames
private static HashMap tds8SpNames
Map of system stored procedures that have shortcuts in TDS8.
tdsVersion
private int tdsVersion
The TDS version being supported by this connection.
cancel
(package private) void cancel(boolean timeout)
Send (only) one cancel packet to the server.
timeout
- true if this is a query timeout cancel
checkOpen
private void checkOpen()
throws SQLException
Check that the connection is still open.
cleanUp
public void cleanUp()
Releases parameter and result set data and metadata to free up memory.
This is useful before the
TdsCore
is cached for reuse.
clearResponseQueue
(package private) void clearResponseQueue()
throws SQLException
Empty the server response queue.
close
(package private) void close()
throws SQLException
Close the TdsCore
connection object and associated streams.
closeConnection
(package private) void closeConnection()
Inform the server that this connection is closing.
Used by Sybase a no-op for Microsoft.
consumeOneResponse
(package private) void consumeOneResponse()
throws SQLException
Consume packets from the server response queue up to (and including) the
first response terminator.
enlistConnection
(package private) byte[] enlistConnection(int type,
byte[] oleTranID)
throws SQLException
Enlist the current connection in a distributed transaction or request the location of the
MSDTC instance controlling the server we are connected to.
type
- set to 0 to request TM address or 1 to enlist connectionoleTranID
- the 40 OLE transaction ID
- a
byte[]
array containing the TM address data
executeSQL
(package private) void executeSQL(String sql,
String procName,
ParamInfo[] parameters,
boolean noMetaData,
int timeOut,
int maxRows,
int maxFieldSize,
boolean sendNow)
throws SQLException
Send an SQL statement with optional parameters to the server.
sql
- SQL statement to executeprocName
- stored procedure to execute or null
parameters
- parameters for call or nullnoMetaData
- suppress meta data for cursor callstimeOut
- optional query timeout or 0maxRows
- the maximum number of data rows to return (-1 to
leave unaltered)maxFieldSize
- the maximum number of bytes in a column to return
(-1 to leave unaltered)sendNow
- whether to send the request now or not
executeSQL42
private void executeSQL42(String sql,
String procName,
ParamInfo[] parameters,
boolean noMetaData,
boolean sendNow)
throws IOException,
SQLException
Execute SQL using TDS 4.2 protocol.
sql
- The SQL statement to execute.procName
- Stored procedure to execute or null.parameters
- Parameters for call or null.noMetaData
- Suppress meta data for cursor calls.
executeSQL50
private void executeSQL50(String sql,
String procName,
ParamInfo[] parameters)
throws IOException,
SQLException
Execute SQL using TDS 5.0 protocol.
sql
- The SQL statement to execute.procName
- Stored procedure to execute or null.parameters
- Parameters for call or null.
executeSQL70
private void executeSQL70(String sql,
String procName,
ParamInfo[] parameters,
boolean noMetaData,
boolean sendNow)
throws IOException,
SQLException
Execute SQL using TDS 7.0 protocol.
sql
- The SQL statement to execute.procName
- Stored procedure to execute or null
.parameters
- Parameters for call or null
.noMetaData
- Suppress meta data for cursor calls.
getBatchCounts
(package private) SQLException getBatchCounts(ArrayList counts,
SQLException sqlEx)
Obtain the counts from a batch of SQL updates.
If an error occurs Sybase will continue processing a batch consisting of
TDS_LANGUAGE records whilst SQL Server will usually stop after the first
error except when the error is caused by a duplicate key.
Sybase will also stop after the first error when executing RPC calls.
Care is taken to ensure that
SQLException
s are chained
because there could be several errors reported in a batch.
counts
- the ArrayList
containing the update countssqlEx
- any previous SQLException
(s) encountered
- updated
SQLException
or null
if no
error has yet occured
getColumns
(package private) ColInfo[] getColumns()
Retrieve the current result set column descriptors.
- The column descriptors as a
ColInfo[]
.
getHostName
private static String getHostName()
Tries to figure out what client name we should identify ourselves as.
Gets the hostname of this machine,
- name to use as the client
getIntFromBuffer
private static int getIntFromBuffer(byte[] buf,
int offset)
getMACAddress
private static byte[] getMACAddress(String macString)
Converts a user supplied MAC address into a byte array.
macString
- the MAC address as a hex string
- the MAC address as a
byte[]
getMessages
public SQLDiagnostic getMessages()
Returns the diagnostic chain for this instance.
getMoreResults
(package private) boolean getMoreResults()
throws SQLException
Get the next result set or update count from the TDS stream.
boolean
if the next item is a result set.
getNextRow
(package private) boolean getNextRow()
throws SQLException
Retrieve the next data row from the result set.
false
if at the end of results, true
otherwise
getParameters
(package private) ParamInfo[] getParameters()
Retrieve the parameter meta data from a Sybase prepare.
- The parameter descriptors as a
ParamInfo[]
.
getReturnStatus
(package private) Integer getReturnStatus()
Retrieve the return status for the current stored procedure.
- The return status as an
Integer
.
getRowData
(package private) Object[] getRowData()
Retrieve the current result set data items.
- the row data as an
Object
array
getShortFromBuffer
private static int getShortFromBuffer(byte[] buf,
int offset)
getTdsVersion
(package private) int getTdsVersion()
Retrieve the TDS protocol version.
- The protocol version as an
int
.
getUpdateCount
(package private) int getUpdateCount()
Retrieve the update count from the current TDS token.
- The update count as an
int
.
isDataInResultSet
(package private) boolean isDataInResultSet()
throws SQLException
Retrieve the status of result set.
This does a quick read ahead and is needed to support the isLast()
method in the ResultSet.
boolean
- true
if there is more data
in the result set.
isEndOfResponse
(package private) boolean isEndOfResponse()
Retrieve the status of the response stream.
boolean
true if the response has been entirely consumed
isPreparedProcedureName
public static boolean isPreparedProcedureName(String procName)
Returns true
if the specified procName
is a sp_prepare or sp_prepexec handle; returns false
otherwise.
procName
- Stored procedure to execute or null
.
true
if the specified procName
is a sp_prepare or sp_prepexec handle; false
otherwise.
isResultSet
(package private) boolean isResultSet()
Retrieve the status of the next result item.
boolean
true if the next item is a result set.
isRowData
(package private) boolean isRowData()
Retrieve the status of the next result item.
boolean
true if the next item is row data.
isUpdateCount
(package private) boolean isUpdateCount()
Retrieve the status of the next result item.
boolean
true if the next item is an update count.
login
(package private) void login(String serverName,
String database,
String user,
String password,
String domain,
String charset,
String appName,
String progName,
String wsid,
String language,
String macAddress,
int packetSize)
throws SQLException
Login to the SQL Server.
serverName
- server host namedatabase
- required databaseuser
- user namepassword
- user passworddomain
- Windows NT domain (or null)charset
- required server character setappName
- application nameprogName
- library namewsid
- workstation IDlanguage
- language to use for server messagesmacAddress
- client network MAC addresspacketSize
- required network packet size
microsoftPrepare
(package private) String microsoftPrepare(String sql,
ParamInfo[] params,
boolean needCursor,
int resultSetType,
int resultSetConcurrency)
throws SQLException
Prepares the SQL for use with Microsoft server.
sql
- the SQL statement to prepare.params
- the actual parameter listneedCursor
- true if a cursorprepare is requiredresultSetType
- value of the resultSetType parameter when
the Statement was createdresultSetConcurrency
- value of the resultSetConcurrency parameter
whenthe Statement was created
- name of the procedure or prepared statement handle.
negotiateSSL
(package private) void negotiateSSL(String instance,
String ssl)
throws IOException,
SQLException
Negotiate SSL settings with SQL 2000+ server.
Server returns the following values for SSL mode:
0 = Certificate installed encrypt login packet only.
- 1 = Certificate installed client requests force encryption.
- 2 = No certificate no encryption possible.
- 3 = Server requests force encryption.
instance
- The server instance name.ssl
- The SSL URL property value.
nextToken
private void nextToken()
throws SQLException
Read the next TDS token from the response stream.
putLoginString
private void putLoginString(String txt,
int len)
throws IOException
Write a TDS login packet string. Text followed by padding followed
by a byte sized length.
readPreLoginPacket
private int readPreLoginPacket()
throws IOException
Process the pre login acknowledgement from the server.
Packet contains; server version no, SSL mode, instance name
and process id.
Server returns the following values for SSL mode:
0 = Certificate installed encrypt login packet only.
- 1 = Certificate installed client requests force encryption.
- 2 = No certificate no encryption possible.
- 3 = Server requests force encryption.
- The server side SSL mode.
send42LoginPkt
private void send42LoginPkt(String serverName,
String user,
String password,
String charset,
String appName,
String progName,
String wsid,
String language,
int packetSize)
throws IOException
TDS 4.2 Login Packet.
serverName
- server host nameuser
- user namepassword
- user passwordcharset
- required server character setappName
- application nameprogName
- program namewsid
- workstation IDlanguage
- server language for messagespacketSize
- required network packet size
send50LoginPkt
private void send50LoginPkt(String serverName,
String user,
String password,
String charset,
String appName,
String progName,
String wsid,
String language,
int packetSize)
throws IOException
serverName
- server host nameuser
- user namepassword
- user passwordcharset
- required server character setappName
- application nameprogName
- library namewsid
- workstation IDlanguage
- server language for messagespacketSize
- required network packet size
sendMSLoginPkt
private void sendMSLoginPkt(String serverName,
String database,
String user,
String password,
String domain,
String appName,
String progName,
String wsid,
String language,
String macAddress,
int netPacketSize)
throws IOException,
SQLException
Send a TDS 7 login packet.
This method incorporates the Windows single sign on code contributed by
Magendran Sathaiah. To invoke single sign on just leave the user name
blank or null. NB. This can only work if the driver is being executed on
a Windows PC and
ntlmauth.dll
is on the path.
serverName
- server host namedatabase
- required databaseuser
- user namepassword
- user passworddomain
- Windows NT domain (or null
)appName
- application nameprogName
- program namewsid
- workstation IDlanguage
- server language for messagesmacAddress
- client network MAC addressnetPacketSize
- TDS packet size to use
sendNtlmChallengeResponse
private void sendNtlmChallengeResponse(byte[] nonce,
String user,
String password,
String domain)
throws java.io.IOException
Send the response to the NTLM authentication challenge.
nonce
- The secret to hash with password.user
- The user name.password
- The user password.domain
- The Windows NT Dommain.
sendPreLoginPacket
private void sendPreLoginPacket(String instance,
boolean forceEncryption)
throws IOException
Send the SQL Server 2000 pre login packet.
Packet contains; netlib version, ssl mode, instance
and process ID.
instance
- forceEncryption
-
setColumns
(package private) void setColumns(ColInfo[] columns)
Sets the column meta data.
columns
- the column descriptor array
setRowCountAndTextSize
private void setRowCountAndTextSize(int rowCount,
int textSize)
throws SQLException
Sets the server row count (to limit the number of rows in a result set)
and text size (to limit the size of returned TEXT/NTEXT fields).
rowCount
- the number of rows to return or 0 for no limit or -1 to
leave as istextSize
- the maximum number of bytes in a TEXT column to return
or -1 to leave as is
startBatch
(package private) void startBatch()
Notifies the
TdsCore
that a batch is starting. This is so
that it knows to use
sp_executesql
for parameterized
queries (because there's no way to prepare a statement in the middle of
a batch).
Sets the
inBatch
flag.
submitSQL
(package private) void submitSQL(String sql)
throws SQLException
Submit a simple SQL statement to the server and process all output.
sql
- the statement to execute
sybasePrepare
(package private) String sybasePrepare(String sql,
ParamInfo[] params)
throws SQLException
Creates a light weight stored procedure on a Sybase server.
sql
- SQL statement to prepareparams
- the actual parameter list
sybaseUnPrepare
(package private) void sybaseUnPrepare(String procName)
throws SQLException
Drops a Sybase temporary stored procedure.
procName
- the temporary procedure name
tds4ColFormatToken
private void tds4ColFormatToken()
throws IOException,
ProtocolException
Process a TDS 4.2 column format token.
tds4ColNamesToken
private void tds4ColNamesToken()
throws IOException
Process a TDS 4.2 column names token.
Note: Will be followed by a COL_FMT token.
tds5DynamicToken
private void tds5DynamicToken()
throws IOException
Process TDS5 dynamic SQL aknowledgements.
tds5ErrorToken
private void tds5ErrorToken()
throws IOException
Process a TDS 5 error or informational message.
tds5ParamFmt2Token
private void tds5ParamFmt2Token()
throws IOException,
ProtocolException
Process TDS 5 Sybase 12+ Dynamic results parameter descriptor.
When returning output parameters this token will be followed
by a TDS5_PARAMS_TOKEN with the actual data.
tds5ParamFmtToken
private void tds5ParamFmtToken()
throws IOException,
ProtocolException
Process TDS 5 Dynamic results parameter descriptors.
With Sybase 12+ this has been superseded by the TDS5_PARAMFMT2_TOKEN
except when used to return extended error information.
tds5ParamsToken
private void tds5ParamsToken()
throws IOException,
ProtocolException,
SQLException
Process TDS 5.0 Params Token.
Stored procedure output parameters or data returned in parameter format
after a TDS Dynamic packet or as extended error information.
The type of the preceding token is inspected to determine if this packet
contains output parameter result data. A TDS5_PARAMFMT2_TOKEN is sent before
this one in Sybase 12 to introduce output parameter results.
A TDS5_PARAMFMT_TOKEN is sent before this one to introduce extended error
information.
tds5ResultToken
private void tds5ResultToken()
throws IOException,
ProtocolException
Process a TDS 5.0 result set packet.
tds5WideResultToken
private void tds5WideResultToken()
throws IOException,
ProtocolException
Process Sybase 12+ wide result token which provides enhanced
column meta data.
tds7CryptPass
private static String tds7CryptPass(String pw)
A very poor man's "encryption".
tds7ResultToken
private void tds7ResultToken()
throws IOException,
ProtocolException,
SQLException
Process a TDS 7.0 result set token.
tdsCapabilityToken
private void tdsCapabilityToken()
throws IOException,
ProtocolException
Processes a TDS 5.0 capability token.
Sent after login to describe the server's capabilities.
tdsColumnInfoToken
private void tdsColumnInfoToken()
throws IOException,
ProtocolException
Process a column infomation token.
Sent by select for browse or cursor functions.
tdsControlToken
private void tdsControlToken()
throws IOException
Process a control token (function unknown).
tdsDoneToken
private void tdsDoneToken()
throws IOException
Process a DONE, DONEINPROC or DONEPROC token.
tdsEnvChangeToken
private void tdsEnvChangeToken()
throws IOException,
SQLException
Process an environment change packet.
tdsErrorToken
private void tdsErrorToken()
throws IOException
Process a TD4/TDS7 error or informational message.
tdsInvalidToken
private void tdsInvalidToken()
throws IOException,
ProtocolException
Report unsupported TDS token in input stream.
tdsLoginAckToken
private void tdsLoginAckToken()
throws IOException
Process a login acknowledgement packet.
tdsNtlmAuthToken
private void tdsNtlmAuthToken()
throws IOException,
ProtocolException
Process a NTLM Authentication challenge.
tdsOffsetsToken
private void tdsOffsetsToken()
throws IOException
Process offsets token.
Used by DBLIB to return the offset of various keywords in a statement.
This saves the client from having to parse a SQL statement. Enabled with
"set offsets from on"
.
tdsOrderByToken
private void tdsOrderByToken()
throws IOException
Process an order by token.
Sent to describe columns in an order by clause.
tdsOutputParamToken
private void tdsOutputParamToken()
throws IOException,
ProtocolException,
SQLException
Process output parameters.
Normally the output parameters are preceded by a TDS type 79
(procedure return value) record; however there are at least two
situations with TDS version 8 where this is not the case:
- For the return value of a SQL 2000+ user defined function.
- For a remote procedure call (server.database.user.procname) where
the 79 record is only sent if a result set is also returned by the remote
procedure. In this case the 79 record just acts as marker for the start of
the output parameters. The actual return value is in an output param token.
Output parameters are distinguished from procedure return values by the value of
a byte that immediately follows the parameter name. A value of 1 seems to indicate
a normal output parameter while a value of 2 indicates a procedure return value.
tdsProcIdToken
private void tdsProcIdToken()
throws IOException
Process procedure ID token.
Used by DBLIB to obtain the object id of a stored procedure.
tdsReturnStatusToken
private void tdsReturnStatusToken()
throws IOException,
SQLException
Process stored procedure return status token.
tdsRowToken
private void tdsRowToken()
throws IOException,
ProtocolException
Process a row data token.
tdsTableNameToken
private void tdsTableNameToken()
throws IOException,
ProtocolException
Process a table name token.
Sent by select for browse or cursor functions.
wait
private void wait(int timeOut)
throws IOException,
SQLException
Waits for the first byte of the server response.
timeOut
- the timeout period in seconds or 0