Java Doc for DateTime.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » client » am » 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 DBMS » db derby 10.2 » org.apache.derby.client.am 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.client.am.DateTime

DateTime
public class DateTime (Code)
High performance converters from date/time byte encodings to JDBC Date, Time and Timestamp objects.

Using this class for direct date/time conversions from bytes offers superior performance over the alternative method of first constructing a Java String from the encoded bytes, and then using java.sql.Date.valueOfjava.sql.Date.valueOf() , java.sql.Time.valueOf java.sql.Time.valueOf() or java.sql.Timestamp.valueOfjava.sql.Timestamp.valueOf() .





Method Summary
final public static  java.sql.DatedateBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding)
    
final public static  java.sql.TimestampdateBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding)
    
final public static  intdateToDateBytes(byte[] buffer, int offset, java.sql.Date date)
     Date is converted to a char representation in JDBC date format: yyyy-mm-dd date format and then converted to bytes using UTF8 encoding
Parameters:
  buffer - bytes in UTF8 encoding of the date
Parameters:
  offset - write into the buffer from this offset
Parameters:
  date - date value DateTime.dateRepresentationLength.
final public static  intdateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date)
     java.sql.Date is converted to character representation that is in DERBY string representation of a timestamp:yyyy-mm-dd-hh.mm.ss.ffffff and then converted to bytes using UTF8 encoding and written out to the buffer
Parameters:
  buffer -
Parameters:
  offset - offset in buffer to start writing to
Parameters:
  date - date value DateTime.timestampRepresentationLength.
final public static  java.sql.TimetimeBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding)
    
final public static  java.sql.TimestamptimeBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding)
    
final public static  inttimeToTimeBytes(byte[] buffer, int offset, java.sql.Time time)
     java.sql.Time is converted to character representation which is in JDBC time escape format: hh:mm:ss, which is the same as JIS time format in DERBY string representation of a time.
final public static  inttimeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time)
    
final public static  java.sql.DatetimestampBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding)
     Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
final public static  java.sql.TimetimestampBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding)
     Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
final public static  java.sql.TimestamptimestampBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding)
     Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
final public static  inttimestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp)
     java.sql.Timestamp is converted to character representation that is in JDBC date escape format: yyyy-mm-dd, which is the same as JIS date format in DERBY string representation of a date. and then converted to bytes using UTF8 encoding.
Parameters:
  buffer -
Parameters:
  offset - write into the buffer from this offset
Parameters:
  timestamp - timestamp value DateTime.dateRepresentationLength.
final public static  inttimestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp)
     java.sql.Timestamp is converted to character representation in JDBC time escape format: hh:mm:ss, which is the same as JIS time format in DERBY string representation of a time.
final public static  inttimestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp)
     java.sql.Timestamp is converted to a character representation which is in DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff. and then converted to bytes using UTF8 encoding
Parameters:
  buffer - bytes in UTF8 encoding of the timestamp
Parameters:
  offset - write into the buffer from this offset
Parameters:
  timestamp - timestamp value DateTime.timestampRepresentationLength.



Method Detail
dateBytesToDate
final public static java.sql.Date dateBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of a date, which is in JIS format: yyyy-mm-dd
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableDate -
Parameters:
  encoding - encoding of buffer data Date translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



dateBytesToTimestamp
final public static java.sql.Timestamp dateBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of a date which is in JIS format: yyyy-mm-dd
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableTimestamp -
Parameters:
  encoding - encoding of buffer Timestamp translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



dateToDateBytes
final public static int dateToDateBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException, UnsupportedEncodingException(Code)
Date is converted to a char representation in JDBC date format: yyyy-mm-dd date format and then converted to bytes using UTF8 encoding
Parameters:
  buffer - bytes in UTF8 encoding of the date
Parameters:
  offset - write into the buffer from this offset
Parameters:
  date - date value DateTime.dateRepresentationLength. This is the fixed length in bytes taken to represent the date value
throws:
  SqlException -
throws:
  UnsupportedEncodingException - if UTF8 Encoding is not supported



dateToTimestampBytes
final public static int dateToTimestampBytes(byte[] buffer, int offset, java.sql.Date date) throws SqlException, UnsupportedEncodingException(Code)
java.sql.Date is converted to character representation that is in DERBY string representation of a timestamp:yyyy-mm-dd-hh.mm.ss.ffffff and then converted to bytes using UTF8 encoding and written out to the buffer
Parameters:
  buffer -
Parameters:
  offset - offset in buffer to start writing to
Parameters:
  date - date value DateTime.timestampRepresentationLength. This is the fixed lengthin bytes, taken to represent the timestamp value.
throws:
  SqlException -
throws:
  UnsupportedEncodingException -



timeBytesToTime
final public static java.sql.Time timeBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of time, which is in the format: hh.mm.ss
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableTime -
Parameters:
  encoding - encoding of buffer Time translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



timeBytesToTimestamp
final public static java.sql.Timestamp timeBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of time which is in the format: hh.mm.ss
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableTimestamp -
Parameters:
  encoding - encoding of buffer Timestamp translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



timeToTimeBytes
final public static int timeToTimeBytes(byte[] buffer, int offset, java.sql.Time time) throws UnsupportedEncodingException(Code)
java.sql.Time is converted to character representation which is in JDBC time escape format: hh:mm:ss, which is the same as JIS time format in DERBY string representation of a time. The char representation is converted to bytes using UTF8 encoding.
Parameters:
  buffer - bytes in UTF8 encoding of the time
Parameters:
  offset - write into the buffer from this offset
Parameters:
  time - java.sql.Time value DateTime.timeRepresentationLength. This is the fixed length in bytes taken to represent the time value
throws:
  UnsupportedEncodingException -



timeToTimestampBytes
final public static int timeToTimestampBytes(byte[] buffer, int offset, java.sql.Time time) throws UnsupportedEncodingException(Code)
java.sql.Time is converted to a character representation that is in DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff and converted to bytes using UTF8 encoding
Parameters:
  buffer -
Parameters:
  offset - offset in buffer to start writing to
Parameters:
  time - time value DateTime.timestampRepresentationLength which is the fixed lengthtaken up by the conversion of time to timestamp in bytes
throws:
  UnsupportedEncodingException -



timestampBytesToDate
final public static java.sql.Date timestampBytesToDate(byte[] buffer, int offset, java.sql.Date recyclableDate, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableDate -
Parameters:
  encoding - encoding of buffer Date translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



timestampBytesToTime
final public static java.sql.Time timestampBytesToTime(byte[] buffer, int offset, java.sql.Time recyclableTime, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableTime -
Parameters:
  encoding - encoding of buffer Time translated from buffer with specified Encoding
throws:
  UnsupportedEncodingException -



timestampBytesToTimestamp
final public static java.sql.Timestamp timestampBytesToTimestamp(byte[] buffer, int offset, java.sql.Timestamp recyclableTimestamp, String encoding) throws UnsupportedEncodingException(Code)
Expected character representation is DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff.
Parameters:
  buffer -
Parameters:
  offset -
Parameters:
  recyclableTimestamp -
Parameters:
  encoding - encoding of buffer TimeStamp translated from buffer with specified encoding
throws:
  UnsupportedEncodingException -



timestampToDateBytes
final public static int timestampToDateBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException, UnsupportedEncodingException(Code)
java.sql.Timestamp is converted to character representation that is in JDBC date escape format: yyyy-mm-dd, which is the same as JIS date format in DERBY string representation of a date. and then converted to bytes using UTF8 encoding.
Parameters:
  buffer -
Parameters:
  offset - write into the buffer from this offset
Parameters:
  timestamp - timestamp value DateTime.dateRepresentationLength. This is the fixed length in bytes, that is taken to represent the timestamp value as a date.
throws:
  SqlException -
throws:
  UnsupportedEncodingException -



timestampToTimeBytes
final public static int timestampToTimeBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws UnsupportedEncodingException(Code)
java.sql.Timestamp is converted to character representation in JDBC time escape format: hh:mm:ss, which is the same as JIS time format in DERBY string representation of a time. The char representation is then converted to bytes using UTF8 encoding and written out into the buffer
Parameters:
  buffer -
Parameters:
  offset - write into the buffer from this offset
Parameters:
  timestamp - timestamp value DateTime.timeRepresentationLength. This is the fixed length in bytes taken to represent the timestamp value as Time.
throws:
  UnsupportedEncodingException -



timestampToTimestampBytes
final public static int timestampToTimestampBytes(byte[] buffer, int offset, java.sql.Timestamp timestamp) throws SqlException, UnsupportedEncodingException(Code)
java.sql.Timestamp is converted to a character representation which is in DERBY string representation of a timestamp: yyyy-mm-dd-hh.mm.ss.ffffff. and then converted to bytes using UTF8 encoding
Parameters:
  buffer - bytes in UTF8 encoding of the timestamp
Parameters:
  offset - write into the buffer from this offset
Parameters:
  timestamp - timestamp value DateTime.timestampRepresentationLength. This is the fixed length in bytes, taken to represent the timestamp value
throws:
  SqlException -
throws:
  UnsupportedEncodingException -



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.