Java Doc for RequestStream.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.RequestStream

RequestStream
public class RequestStream (Code)
Class to implement an output stream for the server request.

Implementation note:

  1. This class contains methods to write different types of data to the server request stream in TDS format.
  2. Character translation of String items is carried out.

author:
   Mike Hutchinson.
version:
   $Id: RequestStream.java,v 1.18 2005/09/21 21:50:34 ddkilzer Exp $



Constructor Summary
 RequestStream(SharedSocket socket, int streamId, int bufferSize, int maxPrecision)
     Construct a RequestStream object.

Method Summary
 voidclose()
     Close the output stream.
 voidflush()
     Flush the packet to the output stream setting the last packet flag.
 intgetBufferSize()
     Retrieve the current output packet size.
 bytegetMaxDecimalBytes()
     Returns the maximum number of bytes required to output a decimal given the current RequestStream.maxPrecision .
 intgetMaxPrecision()
     Retrive the maximum decimal precision.
 intgetServerType()
     Retrieve the Server type.
 intgetStreamId()
     Retrieve the unique stream id.
 intgetTdsVersion()
     Retrieve the TDS version number.
 voidsetBufferSize(int size)
    
 voidsetPacketType(byte pktType)
     Set the current output packet type.
 voidwrite(byte b)
     Write a byte to the output stream.
 voidwrite(byte[] b)
     Write an array of bytes to the output stream.
 voidwrite(byte[] b, int off, int len)
     Write a partial byte buffer to the output stream.
 voidwrite(int i)
     Write an int value to the output stream.
 voidwrite(short s)
     Write a short value to the output stream.
 voidwrite(long l)
     Write a long value to the output stream.
 voidwrite(double f)
     Write a double value to the output stream.
 voidwrite(float f)
     Write a float value to the output stream.
 voidwrite(String s)
     Write a String object to the output stream.
 voidwrite(char s, int off, int len)
     Write a char array object to the output stream.
 voidwrite(BigDecimal value)
     Write a BigDecimal value to the output stream.
 voidwriteAscii(String s)
     Write a String to the output stream as translated bytes.
 voidwriteReaderBytes(Reader in, int length)
     Copy the contents of a Reader stream to the server as bytes.

NB.

 voidwriteReaderChars(Reader in, int length)
     Copy the contents of a Reader stream to the server.
 voidwriteStreamBytes(InputStream in, int length)
     Copy the contents of an InputStream to the server.


Constructor Detail
RequestStream
RequestStream(SharedSocket socket, int streamId, int bufferSize, int maxPrecision)(Code)
Construct a RequestStream object.
Parameters:
  socket - the shared socket object to write to
Parameters:
  streamId - the unique id for this stream
Parameters:
  bufferSize - the initial buffer size to use (the current networkpacket size)
Parameters:
  maxPrecision - the maximum precision for numeric/decimal types




Method Detail
close
void close()(Code)
Close the output stream.



flush
void flush() throws IOException(Code)
Flush the packet to the output stream setting the last packet flag.
throws:
  IOException -



getBufferSize
int getBufferSize()(Code)
Retrieve the current output packet size. the packet size as an int.



getMaxDecimalBytes
byte getMaxDecimalBytes()(Code)
Returns the maximum number of bytes required to output a decimal given the current RequestStream.maxPrecision . the maximum number of bytes required to output a decimal.



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



getServerType
int getServerType()(Code)
Retrieve the Server type. The Server type as an int.



getStreamId
int getStreamId()(Code)
Retrieve the unique stream id. the unique stream id as an int.



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



setBufferSize
void setBufferSize(int size)(Code)
Set the output buffer size
Parameters:
  size - The new buffer size (>= TdsCore.MIN_PKT_SIZE <= TdsCore.MAX_PKT_SIZE).



setPacketType
void setPacketType(byte pktType)(Code)
Set the current output packet type.
Parameters:
  pktType - The packet type eg TdsCore.QUERY_PKT.



write
void write(byte b) throws IOException(Code)
Write a byte to the output stream.
Parameters:
  b - The byte value to write.
throws:
  IOException -



write
void write(byte[] b) throws IOException(Code)
Write an array of bytes to the output stream.
Parameters:
  b - The byte array to write.
throws:
  IOException -



write
void write(byte[] b, int off, int len) throws IOException(Code)
Write a partial byte buffer to the output stream.
Parameters:
  b - The byte array buffer.
Parameters:
  off - The offset into the byte array.
Parameters:
  len - The number of bytes to write.
throws:
  IOException -



write
void write(int i) throws IOException(Code)
Write an int value to the output stream.
Parameters:
  i - The int value to write.
throws:
  IOException -



write
void write(short s) throws IOException(Code)
Write a short value to the output stream.
Parameters:
  s - The short value to write.
throws:
  IOException -



write
void write(long l) throws IOException(Code)
Write a long value to the output stream.
Parameters:
  l - The long value to write.
throws:
  IOException -



write
void write(double f) throws IOException(Code)
Write a double value to the output stream.
Parameters:
  f - The double value to write.
throws:
  IOException -



write
void write(float f) throws IOException(Code)
Write a float value to the output stream.
Parameters:
  f - The float value to write.
throws:
  IOException -



write
void write(String s) throws IOException(Code)
Write a String object to the output stream. If the TDS version is >= 7.0 write a UNICODE string otherwise wrote a translated byte stream.
Parameters:
  s - The String to write.
throws:
  IOException -



write
void write(char s, int off, int len) throws IOException(Code)
Write a char array object to the output stream.
Parameters:
  s - The char[] to write.
throws:
  IOException -



write
void write(BigDecimal value) throws IOException(Code)
Write a BigDecimal value to the output stream.
Parameters:
  value - The BigDecimal value to write.
throws:
  IOException -



writeAscii
void writeAscii(String s) throws IOException(Code)
Write a String to the output stream as translated bytes.
Parameters:
  s - The String to write.
throws:
  IOException -



writeReaderBytes
void writeReaderBytes(Reader in, int length) throws IOException(Code)
Copy the contents of a Reader stream to the server as bytes.

NB. Only reliable where the charset is single byte.
Parameters:
  in - The Reader object with the data.
Parameters:
  length - The length of the data in bytes.
throws:
  IOException -




writeReaderChars
void writeReaderChars(Reader in, int length) throws IOException(Code)
Copy the contents of a Reader stream to the server.
Parameters:
  in - The Reader object with the data.
Parameters:
  length - The length of the data in characters.
throws:
  IOException -



writeStreamBytes
void writeStreamBytes(InputStream in, int length) throws IOException(Code)
Copy the contents of an InputStream to the server.
Parameters:
  in - The InputStream to read.
Parameters:
  length - The length of the stream.
throws:
  IOException -



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.