Java Doc for TdsComm.java in  » Database-JDBC-Connection-Pool » octopus » com » internetcds » jdbc » tds » 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 » octopus » com.internetcds.jdbc.tds 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.internetcds.jdbc.tds.TdsComm

TdsComm
public class TdsComm implements TdsDefinitions(Code)
Handle the communications for a Tds instance.
version:
   $Id: TdsComm.java,v 1.2 2007-10-19 13:21:40 sinisa Exp $
author:
   Craig Spannring
author:
   Igor Petrovski


Field Summary
final public static  byteCANCEL
    
final public static  byteLOGON
    
final public static  byteLOGON70
    
final public static  bytePROC
    
final public static  byteQUERY
    
final public static  byteREPLY
    
final public static  StringcvsVersion
    
final static  intheaderLength
    
static  intid
    
 byteinBuffer
    
 intinBufferIndex
    
 intinBufferLen
    
 intnextOutBufferIndex
    
 byteoutBuffer
    
 intpacketType
    
 intpacketsReceived
    
 intpacketsSent
    
static  intz
    

Constructor Summary
public  TdsComm(Socket sock, int tdsVer_)
    

Method Summary
public  voidappendByte(byte b)
     append a byte onto the end of the logical TDS packet.

Append a byte onto the end of the logical TDS packet.

public  voidappendBytes(byte[] b)
     append an array of bytes onto the end of the logical TDS packet.
public  voidappendBytes(byte[] b, int len, byte pad)
     append an array of bytes onto the end of the logical TDS packet.
public  voidappendChars(String s)
     Appends the 16-bit characters from the caller's string, without narrowing the characters. Sybase let's the client decide what byte order to use but it \ appears that SQLServer 7.0 little-endian byte order.
public  voidappendFlt8(Double value)
     append a Double onto the end of the logical TDS packet.
public  voidappendInt(int i)
    
public  voidappendInt64(long i)
    
public  voidappendShort(short s)
     append a short int onto the end of the logical TDS packet.
public  voidappendTdsInt(int i)
    
public  voidappendTdsShort(short s)
     Appends a short int onto the end of the logical TDS packet.
public  voidbackup()
     put the most recently read byte of data back in the inBuffer.
public  voidclose()
    
public  bytegetByte()
     read a byte of data from the DB server.
public  byte[]getBytes(int len)
    
public  intgetNetShort()
    
public  StringgetString(int len)
     Reads bytes or characters (depending on TDS version) and constructs a string with them. Sybase will let the client choose byte ordering, but SQLServer 7.0 wants little endian only.
public  intgetTdsInt()
    
public  longgetTdsInt64()
    
public  intgetTdsShort()
    
public  bytepeek()
     peek at the next byte of data.

This returns the next byte of data that would be returned by getByte(), but does not actually consume the data. Note- We can't synchronize this method (or most of the other methods in this class) because of the way cancels are handled.

public synchronized  voidsendPacket()
     Send the logical packet.

Send the logical packet the has been constructed.

public  voidskip(int i)
    
public  booleansomeThreadIsBuildingPacket()
    
public synchronized  voidstartPacket(int type)
     start a TDS packet.
This method should be called to start a logical TDS packet.
Parameters:
  type - Type of the packet.

Field Detail
CANCEL
final public static byte CANCEL(Code)



LOGON
final public static byte LOGON(Code)



LOGON70
final public static byte LOGON70(Code)



PROC
final public static byte PROC(Code)



QUERY
final public static byte QUERY(Code)



REPLY
final public static byte REPLY(Code)



cvsVersion
final public static String cvsVersion(Code)



headerLength
final static int headerLength(Code)



id
static int id(Code)



inBuffer
byte inBuffer(Code)



inBufferIndex
int inBufferIndex(Code)



inBufferLen
int inBufferLen(Code)



nextOutBufferIndex
int nextOutBufferIndex(Code)



outBuffer
byte outBuffer(Code)



packetType
int packetType(Code)



packetsReceived
int packetsReceived(Code)



packetsSent
int packetsSent(Code)



z
static int z(Code)




Constructor Detail
TdsComm
public TdsComm(Socket sock, int tdsVer_) throws java.io.IOException(Code)




Method Detail
appendByte
public void appendByte(byte b) throws java.io.IOException(Code)
append a byte onto the end of the logical TDS packet.

Append a byte onto the end of the logical TDS packet. When a physical packet is full send it to the server.
Parameters:
  b - byte to add to the TDS packet




appendBytes
public void appendBytes(byte[] b) throws java.io.IOException(Code)
append an array of bytes onto the end of the logical TDS packet.
Parameters:
  b - bytes to add to the TDS packet



appendBytes
public void appendBytes(byte[] b, int len, byte pad) throws java.io.IOException(Code)
append an array of bytes onto the end of the logical TDS packet.
Parameters:
  b - bytes to add to the TDS packet
Parameters:
  len - maximum number of bytes to transmit
Parameters:
  pad - fill with this byte until len is reached



appendChars
public void appendChars(String s) throws java.io.IOException(Code)
Appends the 16-bit characters from the caller's string, without narrowing the characters. Sybase let's the client decide what byte order to use but it \ appears that SQLServer 7.0 little-endian byte order. Added 2000-06-05



appendFlt8
public void appendFlt8(Double value) throws java.io.IOException(Code)
append a Double onto the end of the logical TDS packet.

Append the Double value onto the end of the TDS packet as a SYBFLT8.
Parameters:
  value - Double to add to the TDS packet




appendInt
public void appendInt(int i) throws java.io.IOException(Code)



appendInt64
public void appendInt64(long i) throws java.io.IOException(Code)



appendShort
public void appendShort(short s) throws java.io.IOException(Code)
append a short int onto the end of the logical TDS packet.


Parameters:
  s - short int to add to the TDS packet




appendTdsInt
public void appendTdsInt(int i) throws java.io.IOException(Code)



appendTdsShort
public void appendTdsShort(short s) throws java.io.IOException(Code)
Appends a short int onto the end of the logical TDS packet.


Parameters:
  s - short int to add to the TDS packet




backup
public void backup()(Code)
put the most recently read byte of data back in the inBuffer.

This function effectivly ungets the last byte read. It is guaranteed to be able to unget the last byte read. Trying to unget multiple bytes is not recomended and will only work so long as all the bytes were in the same physical TDS network packet.
author:
   Craig Spannring




close
public void close()(Code)



getByte
public byte getByte() throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)
read a byte of data from the DB server.

This will return the next byte of data from the DB server.

Warning If there is not data available this method will block.




getBytes
public byte[] getBytes(int len) throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)



getNetShort
public int getNetShort() throws TdsException, java.io.IOException(Code)



getString
public String getString(int len) throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)
Reads bytes or characters (depending on TDS version) and constructs a string with them. Sybase will let the client choose byte ordering, but SQLServer 7.0 wants little endian only. In the interest of simplicity, just use little endian regardless of the type of server. Added 2000-06-05.



getTdsInt
public int getTdsInt() throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)



getTdsInt64
public long getTdsInt64() throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)



getTdsShort
public int getTdsShort() throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)



peek
public byte peek() throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)
peek at the next byte of data.

This returns the next byte of data that would be returned by getByte(), but does not actually consume the data. Note- We can't synchronize this method (or most of the other methods in this class) because of the way cancels are handled. If a thread is waiting for a response from the server the cancelController class must be able to call sendPacket() to cancel the request. The next byte of data that will be returned by getByte()
exception:
  com.internetcds.jdbc.tds.TdsException -
exception:
  java.io.IOException -




sendPacket
public synchronized void sendPacket() throws java.io.IOException(Code)
Send the logical packet.

Send the logical packet the has been constructed.




skip
public void skip(int i) throws com.internetcds.jdbc.tds.TdsException, java.io.IOException(Code)



someThreadIsBuildingPacket
public boolean someThreadIsBuildingPacket()(Code)
Is some thread currently building a logical TDS packet? true iff a packet is being built.



startPacket
public synchronized void startPacket(int type)(Code)
start a TDS packet.
This method should be called to start a logical TDS packet.
Parameters:
  type - Type of the packet. Can be QUERY, LOGON, PROC,REPLY, or CANCEL.



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.