Java Doc for ConnectionJDBC2.java in  » Database-JDBC-Connection-Pool » jTDS » net » sourceforge » jtds » jdbc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database JDBC Connection Pool » jTDS » net.sourceforge.jtds.jdbc 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   net.sourceforge.jtds.jdbc.ConnectionJDBC2

All known Subclasses:   net.sourceforge.jtds.jdbc.ConnectionJDBC3,
ConnectionJDBC2
public class ConnectionJDBC2 implements java.sql.Connection(Code)
jTDS implementation of the java.sql.Connection interface.

Implementation notes:

  1. Environment setting code carried over from old jTDS otherwise generally a new implementation of Connection.
  2. Connection properties and SQLException text messages are loaded from a properties file.
  3. Character set choices are also loaded from a resource file and the original Encoder class has gone.
  4. Prepared SQL statements are converted to procedures in the prepareSQL method.
  5. Use of Stored procedures is optional and controlled via connection property.
  6. This Connection object maintains a table of weak references to associated statements. This allows the connection object to control the statements (for example to close them) but without preventing them being garbage collected in a pooled environment.

author:
   Mike Hutchinson
author:
   Alin Sinpalean
version:
   $Id: ConnectionJDBC2.java,v 1.119 2007/07/08 21:43:02 bheineman Exp $


Field Summary
final public static  intTRANSACTION_SNAPSHOT
     SQL Server custom transaction isolation level.

Constructor Summary
 ConnectionJDBC2(String url, Properties info)
     Create a new database connection.

Method Summary
 voidaddCachedProcedure(String key, ProcEntry proc)
     Add a stored procedure to the cache.
 voidaddStatement(JtdsStatement statement)
     Adds a statement object to the list maintained by the connection.
 voidcheckLocal(String method)
     Checks that this connection is in local transaction mode.
 voidcheckOpen()
     Checks that the connection is still open.
 voidclearSavepoints()
     Releases all savepoints.
public synchronized  voidclearWarnings()
    
public synchronized  voidclose()
     Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

Note: A Connection object is automatically closed when it is garbage collected.

public synchronized  voidcommit()
    
public  StatementcreateStatement()
    
public synchronized  StatementcreateStatement(int type, int concurrency)
    
public  StatementcreateStatement(int type, int concurrency, int holdability)
    
synchronized  voidenlistConnection(byte[] oleTranID)
     Enlists the current connection in a distributed transaction.
 StringgetAppName()
     Retrieves the application name for this connection.
public  booleangetAutoCommit()
    
 intgetBatchSize()
     Retrieves the batch size to be used internally.
 StringgetBindAddress()
     Retrieves the bind address for this connection.
 FilegetBufferDir()
     Returns the directory where data should be buffered to.
 intgetBufferMaxMemory()
     Retrieves the maximum amount of memory in Kb to buffer for all connections.
 intgetBufferMinPackets()
     Retrieves the minimum number of packets to buffer per Statement for this connection.
synchronized  TdsCoregetCachedTds()
     Retrieves the cached TdsCore or null if nothing is cached and resets the cache (sets it to null).
public  StringgetCatalog()
    
protected  StringgetCharset()
     Retrieve the Java charset to use for encoding.
protected  CharsetInfogetCharsetInfo()
     Retrieve the CharsetInfo instance used by this connection.
 byte[]getCollation()
     Retrieve the SQL Server 2000 default collation.
synchronized  StringgetCursorName()
     Retrieves the next unique cursor name.
public  intgetDatabaseMajorVersion()
     Retrieves the DBMS major version.
public  intgetDatabaseMinorVersion()
     Retrieves the DBMS minor version.
 StringgetDatabaseName()
     Retrieves the database name for this connection.
 StringgetDatabaseProductName()
     Retrieves the DBMS product name.
 StringgetDatabaseProductVersion()
     Retrieves the DBMS product version.
 StringgetDomainName()
     Retrieves the domain name for this connection.
public  intgetHoldability()
    
 StringgetInstanceName()
     Retrieves the instance name for this connection.
 booleangetLastUpdateCount()
     Retrieves the status of the lastUpdateCount flag.
 longgetLobBuffer()
     Retrieves the LOB buffer size.
 intgetLoginTimeout()
     Retrieves the login timeout for this connection.
 StringgetMacAddress()
     Retrieves the MAC (ethernet) address for this connection.
 intgetMaxPrecision()
     Retrieves the maximum decimal precision.
 intgetMaxStatements()
     Retrieves the maximum statement cache size.
public  DatabaseMetaDatagetMetaData()
    
 SemaphoregetMutex()
     Retrieves the connection mutex and acquires an exclusive lock on the network connection.
 booleangetNamedPipe()
     Retrieves the named pipe setting for this connection.
 intgetNetPacketSize()
     Retrieves the network packet size.
 intgetPacketSize()
     Retrieves the packet size for this connection.
 StringgetPassword()
     Retrieves the password for this connection.
 intgetPortNumber()
     Retrieves the port number for this connection.
 intgetPrepareSql()
     Retrieves the Prepared SQL method.
 StringgetProcName()
     Retrieves the next unique stored procedure name.
 StringgetProgName()
     Retrieves the program name for this connection.
public  StringgetRmHost()
     Retrieves the host and port for this connection.
 intgetRowCount()
     Retrieves the current row count on this connection.
 StringgetServerName()
     Retrieves the server name for this connection.
public  intgetServerType()
     Retrieves the server type.
 SharedSocketgetSocket()
     Retrive the shared socket.
 intgetSocketTimeout()
     Retrieves the socket timeout for this connection.
protected  booleangetSybaseInfo(int flag)
     Retrieve the Sybase capability data.
 booleangetTcpNoDelay()
     Retrieves the tcpNoDelay setting for this connection.
 intgetTdsVersion()
     Retrieve the TDS protocol version.
public  intgetTextSize()
     Retrieves the current maximum textsize on this connection.
public  intgetTransactionIsolation()
    
public  MapgetTypeMap()
    
 StringgetURL()
     Retrieves the original connection URL.
 booleangetUseCursors()
     Indicates whether fast forward only cursors should be used for forward only result sets.
 booleangetUseJCIFS()
     Retrieves the useJCIFS setting for this connection.
 booleangetUseLOBs()
     Indicates whether large types (IMAGE and TEXT/NTEXT) should be mapped by default to LOB types or String and byte[] respectively.
 booleangetUseMetadataCache()
     Retrieves the boolean indicating whether metadata caching is enabled.
 booleangetUseNTLMv2()
     Indicates whether, when doing Windows authentication to an MS SQL server, NTLMv2 should be used.
protected  booleangetUseUnicode()
     Retrieve the sendParametersAsUnicode flag.
 StringgetUser()
     Retrieves the user for this connection.
public  SQLWarninggetWarnings()
    
 StringgetWsid()
     Retrieves the workstation ID (WSID) for this connection.
 intgetXaState()
     Retrieves the XA state variable.
 ObjectgetXid()
     Gets the XA transaction ID when running in emulation mode.
 booleanisCharsetSpecified()
     Retrieves whether a specific charset was requested on creation.
public  booleanisClosed()
    
public  booleanisReadOnly()
    
protected  booleanisWideChar()
     Retrieve the multibyte status of the current character set.
 booleanisXaEmulation()
     Retrieves the XA Emulation flag.
public  StringnativeSQL(String sql)
    
static  voidnotImplemented(String method)
     Reports that user tried to call a method which has not been implemented.
public  CallableStatementprepareCall(String sql)
    
public synchronized  CallableStatementprepareCall(String sql, int type, int concurrency)
    
public  CallableStatementprepareCall(String sql, int type, int concurrency, int holdability)
    
synchronized  StringprepareSQL(JtdsPreparedStatement pstmt, String sql, ParamInfo[] params, boolean returnKeys, boolean cursorNeeded)
     Try to convert the SQL statement into a statement prepare.
public  PreparedStatementprepareStatement(String sql)
    
public  PreparedStatementprepareStatement(String sql, int autoGeneratedKeys)
    
public synchronized  PreparedStatementprepareStatement(String sql, int type, int concurrency)
    
public  PreparedStatementprepareStatement(String sql, int type, int concurrency, int holdability)
    
public  PreparedStatementprepareStatement(String sql, int[] columnIndexes)
    
public  PreparedStatementprepareStatement(String sql, String[] columnNames)
    
public  voidreleaseSavepoint(Savepoint savepoint)
    
synchronized  voidreleaseTds(TdsCore tds)
     Releases (either closes or caches) a TdsCore.
 voidremoveCachedProcedure(String key)
     Remove a stored procedure from the cache.
synchronized  voidremoveStatement(JtdsStatement statement)
     Removes a statement object from the list maintained by the connection and cleans up the statement cache if necessary.
public synchronized  voidrollback()
    
public  voidrollback(Savepoint savepoint)
    
synchronized  byte[][]sendXaPacket(int args, byte[] data)
     Invokes the xp_jtdsxa extended stored procedure on the server.

Synchronized because it accesses the baseTds.
Parameters:
  args - the arguments eg cmd, rmid, flags etc.
Parameters:
  data - option byte data eg open string xid etc.

public synchronized  voidsetAutoCommit(boolean autoCommit)
    
public synchronized  voidsetCatalog(String catalog)
    
 voidsetClosed()
     Forces the closed status on the statement if an I/O error has occurred.
 voidsetCollation(byte[] collation)
     Set the default collation for this connection.

Set by a SQL Server 2000 environment change packet.

protected  voidsetDBServerInfo(String databaseProductName, int databaseMajorVersion, int databaseMinorVersion, int buildNumber)
     Update the connection instance with information about the server.
protected  voidsetDatabase(String newDb, String oldDb)
     Called by the protcol to change the current database context.
public  voidsetHoldability(int holdability)
    
 voidsetNetPacketSize(int size)
     Sets the network packet size.
public  voidsetReadOnly(boolean readOnly)
    
 voidsetRowCount(int count)
     Sets the current row count on this connection.
public  SavepointsetSavepoint()
    
public  SavepointsetSavepoint(String name)
    
protected  voidsetServerCharset(String charset)
     Called by the protocol to change the current character set.
protected  voidsetSybaseInfo(int mask)
     Set the Sybase capability data.
public  voidsetTextSize(int textSize)
     Sets the current maximum textsize on this connection.
public synchronized  voidsetTransactionIsolation(int level)
    
public  voidsetTypeMap(Map map)
    
 voidsetXaState(int value)
     Sets the XA state variable.
 voidsetXid(Object xid)
     Sets the XA transaction ID when running in emulation mode.
protected  voidunpackProperties(Properties info)
     Transfers the properties to the local instance variables.

Field Detail
TRANSACTION_SNAPSHOT
final public static int TRANSACTION_SNAPSHOT(Code)
SQL Server custom transaction isolation level.




Constructor Detail
ConnectionJDBC2
ConnectionJDBC2(String url, Properties info) throws SQLException(Code)
Create a new database connection.
Parameters:
  url - The connection URL starting jdbc:jtds:.
Parameters:
  info - The additional connection properties.
throws:
  SQLException -




Method Detail
addCachedProcedure
void addCachedProcedure(String key, ProcEntry proc)(Code)
Add a stored procedure to the cache.

Not explicitly synchronized because it's only called by synchronized methods.
Parameters:
  key - The signature of the procedure to cache.
Parameters:
  proc - The stored procedure descriptor.




addStatement
void addStatement(JtdsStatement statement)(Code)
Adds a statement object to the list maintained by the connection.

WeakReferences are used so that statements can still be closed and garbage collected even if not explicitly closed by the connection.
Parameters:
  statement - statement to add




checkLocal
void checkLocal(String method) throws SQLException(Code)
Checks that this connection is in local transaction mode.
Parameters:
  method - the method name being tested
throws:
  SQLException - if in XA distributed transaction mode



checkOpen
void checkOpen() throws SQLException(Code)
Checks that the connection is still open.
throws:
  SQLException - if the connection is closed



clearSavepoints
void clearSavepoints()(Code)
Releases all savepoints. Used internally when committing or rolling back a transaction.



clearWarnings
public synchronized void clearWarnings() throws SQLException(Code)



close
public synchronized void close() throws SQLException(Code)
Releases this Connection object's database and JDBC resources immediately instead of waiting for them to be automatically released.

Calling the method close on a Connection object that is already closed is a no-op.

Note: A Connection object is automatically closed when it is garbage collected. Certain fatal errors also close a Connection object.

Synchronized because it accesses the statement list and the baseTds.
throws:
  SQLException - if a database access error occurs




commit
public synchronized void commit() throws SQLException(Code)



createStatement
public Statement createStatement() throws SQLException(Code)



createStatement
public synchronized Statement createStatement(int type, int concurrency) throws SQLException(Code)



createStatement
public Statement createStatement(int type, int concurrency, int holdability) throws SQLException(Code)



enlistConnection
synchronized void enlistConnection(byte[] oleTranID) throws SQLException(Code)
Enlists the current connection in a distributed transaction.
Parameters:
  oleTranID - the OLE transaction cookie or null to delist
throws:
  SQLException - if an error condition occurs



getAppName
String getAppName()(Code)
Retrieves the application name for this connection. the application name



getAutoCommit
public boolean getAutoCommit() throws SQLException(Code)



getBatchSize
int getBatchSize()(Code)
Retrieves the batch size to be used internally. the batch size as an int



getBindAddress
String getBindAddress()(Code)
Retrieves the bind address for this connection. the bind address



getBufferDir
File getBufferDir()(Code)
Returns the directory where data should be buffered to. the directory where data should be buffered to.



getBufferMaxMemory
int getBufferMaxMemory()(Code)
Retrieves the maximum amount of memory in Kb to buffer for all connections. the maximum amount of memory in Kb to buffer for all connections



getBufferMinPackets
int getBufferMinPackets()(Code)
Retrieves the minimum number of packets to buffer per Statement for this connection. the minimum number of packets to buffer per Statement



getCachedTds
synchronized TdsCore getCachedTds()(Code)
Retrieves the cached TdsCore or null if nothing is cached and resets the cache (sets it to null). the value of ConnectionJDBC2.cachedTds



getCatalog
public String getCatalog() throws SQLException(Code)



getCharset
protected String getCharset()(Code)
Retrieve the Java charset to use for encoding. the Charset name as a String



getCharsetInfo
protected CharsetInfo getCharsetInfo()(Code)
Retrieve the CharsetInfo instance used by this connection. the default CharsetInfo for this connection



getCollation
byte[] getCollation()(Code)
Retrieve the SQL Server 2000 default collation. The collation as a byte[5].



getCursorName
synchronized String getCursorName()(Code)
Retrieves the next unique cursor name. the next cursor name as a String



getDatabaseMajorVersion
public int getDatabaseMajorVersion()(Code)
Retrieves the DBMS major version. the version as an int



getDatabaseMinorVersion
public int getDatabaseMinorVersion()(Code)
Retrieves the DBMS minor version. the version as an int



getDatabaseName
String getDatabaseName()(Code)
Retrieves the database name for this connection. the database name



getDatabaseProductName
String getDatabaseProductName()(Code)
Retrieves the DBMS product name. the name as a String



getDatabaseProductVersion
String getDatabaseProductVersion()(Code)
Retrieves the DBMS product version. the version as a String



getDomainName
String getDomainName()(Code)
Retrieves the domain name for this connection. the domain name



getHoldability
public int getHoldability() throws SQLException(Code)



getInstanceName
String getInstanceName()(Code)
Retrieves the instance name for this connection. the instance name



getLastUpdateCount
boolean getLastUpdateCount()(Code)
Retrieves the status of the lastUpdateCount flag. the lastUpdateCount flag as a boolean



getLobBuffer
long getLobBuffer()(Code)
Retrieves the LOB buffer size. the LOB buffer size as a long



getLoginTimeout
int getLoginTimeout()(Code)
Retrieves the login timeout for this connection. the login timeout



getMacAddress
String getMacAddress()(Code)
Retrieves the MAC (ethernet) address for this connection. the MAC (ethernet) address



getMaxPrecision
int getMaxPrecision()(Code)
Retrieves the maximum decimal precision. the precision as an int



getMaxStatements
int getMaxStatements()(Code)
Retrieves the maximum statement cache size. the maximum statement cache size



getMetaData
public DatabaseMetaData getMetaData() throws SQLException(Code)



getMutex
Semaphore getMutex()(Code)
Retrieves the connection mutex and acquires an exclusive lock on the network connection. the mutex object as a Semaphore



getNamedPipe
boolean getNamedPipe()(Code)
Retrieves the named pipe setting for this connection. the named pipe setting



getNetPacketSize
int getNetPacketSize()(Code)
Retrieves the network packet size. the packet size as an int



getPacketSize
int getPacketSize()(Code)
Retrieves the packet size for this connection. the packet size



getPassword
String getPassword()(Code)
Retrieves the password for this connection. the password



getPortNumber
int getPortNumber()(Code)
Retrieves the port number for this connection. the port number



getPrepareSql
int getPrepareSql()(Code)
Retrieves the Prepared SQL method. the Prepared SQL method



getProcName
String getProcName()(Code)
Retrieves the next unique stored procedure name.

Notes:

  1. Some versions of Sybase require an id with a length of <= 10.
  2. The format of this name works for sybase and Microsoft and allows for 16M names per session.
  3. The leading '#jtds' indicates this is a temporary procedure and the '#' is removed by the lower level TDS5 routines.
Not synchronized because it's only called from the synchronized ConnectionJDBC2.prepareSQL method. the next temporary SP name as a String



getProgName
String getProgName()(Code)
Retrieves the program name for this connection. the program name



getRmHost
public String getRmHost()(Code)
Retrieves the host and port for this connection.

Used to identify same resource manager in XA transactions. the hostname and port as a String




getRowCount
int getRowCount()(Code)
Retrieves the current row count on this connection. the row count as an int



getServerName
String getServerName()(Code)
Retrieves the server name for this connection. the server name



getServerType
public int getServerType()(Code)
Retrieves the server type. the server type as an int where 1 == SQLSERVER and2 == SYBASE.



getSocket
SharedSocket getSocket()(Code)
Retrive the shared socket. The SharedSocket object.



getSocketTimeout
int getSocketTimeout()(Code)
Retrieves the socket timeout for this connection. the socket timeout



getSybaseInfo
protected boolean getSybaseInfo(int flag)(Code)
Retrieve the Sybase capability data. Capability bit mask as an int.



getTcpNoDelay
boolean getTcpNoDelay()(Code)
Retrieves the tcpNoDelay setting for this connection. the tcpNoDelay setting



getTdsVersion
int getTdsVersion()(Code)
Retrieve the TDS protocol version. The TDS version as an int.



getTextSize
public int getTextSize()(Code)
Retrieves the current maximum textsize on this connection. the maximum textsize as an int



getTransactionIsolation
public int getTransactionIsolation() throws SQLException(Code)



getTypeMap
public Map getTypeMap() throws SQLException(Code)



getURL
String getURL()(Code)
Retrieves the original connection URL. the connection url as a String



getUseCursors
boolean getUseCursors()(Code)
Indicates whether fast forward only cursors should be used for forward only result sets. true if fast forward cursors are requested



getUseJCIFS
boolean getUseJCIFS()(Code)
Retrieves the useJCIFS setting for this connection. the useJCIFS setting



getUseLOBs
boolean getUseLOBs()(Code)
Indicates whether large types (IMAGE and TEXT/NTEXT) should be mapped by default to LOB types or String and byte[] respectively. true if the default mapping should be to LOBs,false otherwise



getUseMetadataCache
boolean getUseMetadataCache()(Code)
Retrieves the boolean indicating whether metadata caching is enabled. true if metadata caching is enabled,false if caching is disabled



getUseNTLMv2
boolean getUseNTLMv2()(Code)
Indicates whether, when doing Windows authentication to an MS SQL server, NTLMv2 should be used. When this is set to "false", LM and NTLM responses are sent to the server, which should work fine in most cases. However, some servers are configured to require LMv2 and NTLMv2. In these rare cases, this property should be set to "true".



getUseUnicode
protected boolean getUseUnicode()(Code)
Retrieve the sendParametersAsUnicode flag. boolean true if parameters should be sent as unicode.



getUser
String getUser()(Code)
Retrieves the user for this connection. the user



getWarnings
public SQLWarning getWarnings() throws SQLException(Code)



getWsid
String getWsid()(Code)
Retrieves the workstation ID (WSID) for this connection. the workstation ID (WSID)



getXaState
int getXaState()(Code)
Retrieves the XA state variable. the xa state variable as an int



getXid
Object getXid()(Code)
Gets the XA transaction ID when running in emulation mode. the transaction ID as an Object



isCharsetSpecified
boolean isCharsetSpecified()(Code)
Retrieves whether a specific charset was requested on creation. If this is the case, all character data should be encoded/decoded using that charset.



isClosed
public boolean isClosed() throws SQLException(Code)



isReadOnly
public boolean isReadOnly() throws SQLException(Code)



isWideChar
protected boolean isWideChar()(Code)
Retrieve the multibyte status of the current character set. boolean true if a multi byte character set



isXaEmulation
boolean isXaEmulation()(Code)
Retrieves the XA Emulation flag. True if in XA emulation mode.



nativeSQL
public String nativeSQL(String sql) throws SQLException(Code)



notImplemented
static void notImplemented(String method) throws SQLException(Code)
Reports that user tried to call a method which has not been implemented.
Parameters:
  method - the method name to report in the error message
throws:
  SQLException - always, with the not implemented message



prepareCall
public CallableStatement prepareCall(String sql) throws SQLException(Code)



prepareCall
public synchronized CallableStatement prepareCall(String sql, int type, int concurrency) throws SQLException(Code)



prepareCall
public CallableStatement prepareCall(String sql, int type, int concurrency, int holdability) throws SQLException(Code)



prepareSQL
synchronized String prepareSQL(JtdsPreparedStatement pstmt, String sql, ParamInfo[] params, boolean returnKeys, boolean cursorNeeded) throws SQLException(Code)
Try to convert the SQL statement into a statement prepare.

Synchronized because it accesses the procedure cache and the baseTds, but the method call also needs to made in a synchronized (connection) block together with the execution (if the prepared statement is actually executed) to ensure the transaction isn't rolled back between this method call and the actual execution.
Parameters:
  pstmt - the target prepared statement
Parameters:
  sql - the SQL statement to prepare
Parameters:
  params - the parameters
Parameters:
  returnKeys - indicates whether the statement will returngenerated keys
Parameters:
  cursorNeeded - indicates whether a cursor prepare is needed the SQL procedure name as a String or null if theSQL cannot be prepared




prepareStatement
public PreparedStatement prepareStatement(String sql) throws SQLException(Code)



prepareStatement
public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException(Code)



prepareStatement
public synchronized PreparedStatement prepareStatement(String sql, int type, int concurrency) throws SQLException(Code)



prepareStatement
public PreparedStatement prepareStatement(String sql, int type, int concurrency, int holdability) throws SQLException(Code)



prepareStatement
public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException(Code)



prepareStatement
public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException(Code)



releaseSavepoint
public void releaseSavepoint(Savepoint savepoint) throws SQLException(Code)



releaseTds
synchronized void releaseTds(TdsCore tds) throws SQLException(Code)
Releases (either closes or caches) a TdsCore.
Parameters:
  tds - the TdsCore instance to release
throws:
  SQLException - if an error occurs while closing or cleaning up



removeCachedProcedure
void removeCachedProcedure(String key)(Code)
Remove a stored procedure from the cache.

Not explicitly synchronized because it's only called by synchronized methods.
Parameters:
  key - The signature of the procedure to remove from the cache.




removeStatement
synchronized void removeStatement(JtdsStatement statement) throws SQLException(Code)
Removes a statement object from the list maintained by the connection and cleans up the statement cache if necessary.

Synchronized because it accesses the statement list, the statement cache and the baseTds.
Parameters:
  statement - the statement to remove




rollback
public synchronized void rollback() throws SQLException(Code)



rollback
public void rollback(Savepoint savepoint) throws SQLException(Code)



sendXaPacket
synchronized byte[][] sendXaPacket(int args, byte[] data) throws SQLException(Code)
Invokes the xp_jtdsxa extended stored procedure on the server.

Synchronized because it accesses the baseTds.
Parameters:
  args - the arguments eg cmd, rmid, flags etc.
Parameters:
  data - option byte data eg open string xid etc. optional byte data eg OLE cookie
throws:
  SQLException - if an error condition occurs




setAutoCommit
public synchronized void setAutoCommit(boolean autoCommit) throws SQLException(Code)



setCatalog
public synchronized void setCatalog(String catalog) throws SQLException(Code)



setClosed
void setClosed()(Code)
Forces the closed status on the statement if an I/O error has occurred.



setCollation
void setCollation(byte[] collation) throws SQLException(Code)
Set the default collation for this connection.

Set by a SQL Server 2000 environment change packet. The collation consists of the following fields:

  • bits 0-19 - The locale eg 0x0409 for US English which maps to code page 1252 (Latin1_General).
  • bits 20-31 - Reserved.
  • bits 32-39 - Sort order (csid from syscharsets)
If the sort order is non-zero it determines the character set, otherwise the character set is determined by the locale id.
Parameters:
  collation - The new collation.



setDBServerInfo
protected void setDBServerInfo(String databaseProductName, int databaseMajorVersion, int databaseMinorVersion, int buildNumber)(Code)
Update the connection instance with information about the server.
Parameters:
  databaseProductName - The server name eg SQL Server.
Parameters:
  databaseMajorVersion - The major version eg 11
Parameters:
  databaseMinorVersion - The minor version eg 92
Parameters:
  buildNumber - The server build number.



setDatabase
protected void setDatabase(String newDb, String oldDb) throws SQLException(Code)
Called by the protcol to change the current database context.
Parameters:
  newDb - The new database selected on the server.
Parameters:
  oldDb - The old database as known by the server.
throws:
  SQLException -



setHoldability
public void setHoldability(int holdability) throws SQLException(Code)



setNetPacketSize
void setNetPacketSize(int size)(Code)
Sets the network packet size.
Parameters:
  size - the new packet size



setReadOnly
public void setReadOnly(boolean readOnly) throws SQLException(Code)



setRowCount
void setRowCount(int count)(Code)
Sets the current row count on this connection.
Parameters:
  count - the new row count



setSavepoint
public Savepoint setSavepoint() throws SQLException(Code)



setSavepoint
public Savepoint setSavepoint(String name) throws SQLException(Code)



setServerCharset
protected void setServerCharset(String charset) throws SQLException(Code)
Called by the protocol to change the current character set.
Parameters:
  charset - the server character set name



setSybaseInfo
protected void setSybaseInfo(int mask)(Code)
Set the Sybase capability data.
Parameters:
  mask - The capability bit mask.



setTextSize
public void setTextSize(int textSize)(Code)
Sets the current maximum textsize on this connection.
Parameters:
  textSize - the new maximum textsize



setTransactionIsolation
public synchronized void setTransactionIsolation(int level) throws SQLException(Code)



setTypeMap
public void setTypeMap(Map map) throws SQLException(Code)



setXaState
void setXaState(int value)(Code)
Sets the XA state variable.
Parameters:
  value - the XA state value



setXid
void setXid(Object xid)(Code)
Sets the XA transaction ID when running in emulation mode.
Parameters:
  xid - the XA Transaction ID



unpackProperties
protected void unpackProperties(Properties info) throws SQLException(Code)
Transfers the properties to the local instance variables.
Parameters:
  info - The connection properties Object.
throws:
  SQLException - If an invalid property value is found.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.