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

DateTime
public class DateTime (Code)
Encapsulates Sybase date/time values and provides conversions to and from Java classes.
author:
   Mike Hutchinson
version:
   $Id: DateTime.java,v 1.4 2005/07/11 13:33:30 alin_sinpalean Exp $


Field Summary
final static  intDATE_NOT_USED
     Indicates date value not used.
final static  intTIME_NOT_USED
     Indicates time value not used.

Constructor Summary
 DateTime(int date, int time)
     Constructs a DateTime object from the two integer components of a datetime.
 DateTime(short date, short time)
     Constructs a DateTime object from the two short components of a smalldatetime.
 DateTime(Timestamp ts)
     Constructs a DateTime object from a java.sql.Timestamp.
 DateTime(Time t)
     Constructs a DateTime object from a java.sql.Time.
 DateTime(Date d)
     Constructs a DateTime object from a java.sql.Date.

Method Summary
 intgetDate()
     Retrieves the date component of a datetime value.
 intgetTime()
     Retrieves the time component of a datetime value.
public  voidpackDate()
     Converts a calendar date into days since 1900 (Sybase epoch).
public  voidpackTime()
     Converts separate time components into a datetime time value.
public  DatetoDate()
     Retrieves the current datetime value as a Date.
public  ObjecttoObject()
     Retrieves the current datetime value as a Time, Date or Timestamp.
public  StringtoString()
     Retrieves the current datetime value as a String.
public  TimetoTime()
     Retrieves the current datetime value as a Time.
public  TimestamptoTimestamp()
     Retrieves the current datetime value as a Timestamp.

Field Detail
DATE_NOT_USED
final static int DATE_NOT_USED(Code)
Indicates date value not used.



TIME_NOT_USED
final static int TIME_NOT_USED(Code)
Indicates time value not used.




Constructor Detail
DateTime
DateTime(int date, int time)(Code)
Constructs a DateTime object from the two integer components of a datetime.
Parameters:
  date - server date field
Parameters:
  time - server time field



DateTime
DateTime(short date, short time)(Code)
Constructs a DateTime object from the two short components of a smalldatetime.
Parameters:
  date - server date field
Parameters:
  time - server time field



DateTime
DateTime(Timestamp ts) throws SQLException(Code)
Constructs a DateTime object from a java.sql.Timestamp.
Parameters:
  ts - Timestamp object representing the datetime
throws:
  SQLException - if the date is out of range



DateTime
DateTime(Time t)(Code)
Constructs a DateTime object from a java.sql.Time.
Parameters:
  t - Time object representing the datetime



DateTime
DateTime(Date d) throws SQLException(Code)
Constructs a DateTime object from a java.sql.Date.
Parameters:
  d - Date object representing the datetime
throws:
  SQLException - if the Date is out of range




Method Detail
getDate
int getDate()(Code)
Retrieves the date component of a datetime value. the datetime date component as an int



getTime
int getTime()(Code)
Retrieves the time component of a datetime value. the datetime time component as an int



packDate
public void packDate() throws SQLException(Code)
Converts a calendar date into days since 1900 (Sybase epoch).

Algorithm from Fliegel, H F and van Flandern, T C (1968). Communications of the ACM, Vol 11, No 10 (October, 1968).

 INTEGER FUNCTION JD (YEAR,MONTH,DAY)
 C
 C---COMPUTES THE JULIAN DATE (JD) GIVEN A GREGORIAN CALENDAR
 C   DATE (YEAR,MONTH,DAY).
 C
 INTEGER YEAR,MONTH,DAY,I,J,K
 C
 I= YEAR
 J= MONTH
 K= DAY
 C
 JD= K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)
 2    /12-3*((I+4900+(J-14)/12)/100)/4
 C
 RETURN
 END
 

throws:
  java.sql.SQLException - if the date is outside the accepted range, 1753-9999



packTime
public void packTime()(Code)
Converts separate time components into a datetime time value.



toDate
public Date toDate()(Code)
Retrieves the current datetime value as a Date. the current datetime value as a java.sql.Date



toObject
public Object toObject()(Code)
Retrieves the current datetime value as a Time, Date or Timestamp. the current datetime value as an java.lang.Object



toString
public String toString()(Code)
Retrieves the current datetime value as a String. the current datetime value as a String



toTime
public Time toTime()(Code)
Retrieves the current datetime value as a Time. the current datetime value as a java.sql.Time



toTimestamp
public Timestamp toTimestamp()(Code)
Retrieves the current datetime value as a Timestamp. the current datetime value as a java.sql.Timestamp



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.