Java Doc for Date.java in  » 6.0-JDK-Core » sql » java » sql » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Home
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
26.ERP CRM Financial
27.ESB
28.Forum
29.Game
30.GIS
31.Graphic 3D
32.Graphic Library
33.Groupware
34.HTML Parser
35.IDE
36.IDE Eclipse
37.IDE Netbeans
38.Installer
39.Internationalization Localization
40.Inversion of Control
41.Issue Tracking
42.J2EE
43.J2ME
44.JBoss
45.JMS
46.JMX
47.Library
48.Mail Clients
49.Music
50.Net
51.Parser
52.PDF
53.Portal
54.Profiler
55.Project Management
56.Report
57.RSS RDF
58.Rule Engine
59.Science
60.Scripting
61.Search Engine
62.Security
63.Sevlet Container
64.Source Control
65.Swing Library
66.Template Engine
67.Test Coverage
68.Testing
69.UML
70.Web Crawler
71.Web Framework
72.Web Mail
73.Web Server
74.Web Services
75.Web Services apache cxf 2.2.6
76.Web Services AXIS2
77.Wiki Engine
78.Workflow Engines
79.XML
80.XML UI
Java Source Code / Java Documentation » 6.0 JDK Core » sql » java.sql 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.util.Date
      java.sql.Date

Date
public class Date extends java.util.Date (Code)

A thin wrapper around a millisecond value that allows JDBC to identify this as an SQL DATE value. A milliseconds value represents the number of milliseconds that have passed since January 1, 1970 00:00:00.000 GMT.

To conform with the definition of SQL DATE, the millisecond values wrapped by a java.sql.Date instance must be 'normalized' by setting the hours, minutes, seconds, and milliseconds to zero in the particular time zone with which the instance is associated.



Field Summary
final static  longserialVersionUID
     Private serial version unique ID to ensure serialization compatibility.

Constructor Summary
public  Date(int year, int month, int day)
     Constructs a Date object initialized with the given year, month, and day.

The result is undefined if a given argument is out of bounds.
Parameters:
  year - the year minus 1900; must be 0 to 8099.

public  Date(long date)
     Constructs a Date object using the given milliseconds time value.

Method Summary
public  intgetHours()
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  intgetMinutes()
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  intgetSeconds()
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  voidsetHours(int i)
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  voidsetMinutes(int i)
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  voidsetSeconds(int i)
     This method is deprecated and should not be used because SQL Date values do not have a time component.
public  voidsetTime(long date)
     Sets an existing Date object using the given milliseconds time value.
public  StringtoString()
     Formats a date in the date escape format yyyy-mm-dd.
public static  DatevalueOf(String s)
     Converts a string in JDBC date escape format to a Date value.

Field Detail
serialVersionUID
final static long serialVersionUID(Code)
Private serial version unique ID to ensure serialization compatibility.




Constructor Detail
Date
public Date(int year, int month, int day)(Code)
Constructs a Date object initialized with the given year, month, and day.

The result is undefined if a given argument is out of bounds.
Parameters:
  year - the year minus 1900; must be 0 to 8099. (Note that8099 is 9999 minus 1900.)
Parameters:
  month - 0 to 11
Parameters:
  day - 1 to 31




Date
public Date(long date)(Code)
Constructs a Date object using the given milliseconds time value. If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT.
Parameters:
  date - milliseconds since January 1, 1970, 00:00:00 GMT notto exceed the milliseconds representation for the year 8099.A negative number indicates the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.




Method Detail
getHours
public int getHours()(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.setHours



getMinutes
public int getMinutes()(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.setMinutes



getSeconds
public int getSeconds()(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.setSeconds



setHours
public void setHours(int i)(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.getHours



setMinutes
public void setMinutes(int i)(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.getMinutes



setSeconds
public void setSeconds(int i)(Code)
This method is deprecated and should not be used because SQL Date values do not have a time component.
exception:
  java.lang.IllegalArgumentException - if this method is invoked
See Also:   Date.getSeconds



setTime
public void setTime(long date)(Code)
Sets an existing Date object using the given milliseconds time value. If the given milliseconds value contains time information, the driver will set the time components to the time in the default time zone (the time zone of the Java virtual machine running the application) that corresponds to zero GMT.
Parameters:
  date - milliseconds since January 1, 1970, 00:00:00 GMT notto exceed the milliseconds representation for the year 8099.A negative number indicates the number of millisecondsbefore January 1, 1970, 00:00:00 GMT.



toString
public String toString()(Code)
Formats a date in the date escape format yyyy-mm-dd.

a String in yyyy-mm-dd format




valueOf
public static Date valueOf(String s)(Code)
Converts a string in JDBC date escape format to a Date value.
Parameters:
  s - a String object representing a date in in the format "yyyy-mm-dd" a java.sql.Date object representing thegiven date
throws:
  IllegalArgumentException - if the date given is not in theJDBC date escape format (yyyy-mm-dd)



Methods inherited from java.util.Date
public static long UTC(int year, int month, int date, int hrs, int min, int sec)(Code)(Java Doc)
public boolean after(Date when)(Code)(Java Doc)
public boolean before(Date when)(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public int compareTo(Date anotherDate)(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
public int getDate()(Code)(Java Doc)
public int getDay()(Code)(Java Doc)
public int getHours()(Code)(Java Doc)
public int getMinutes()(Code)(Java Doc)
public int getMonth()(Code)(Java Doc)
public int getSeconds()(Code)(Java Doc)
public long getTime()(Code)(Java Doc)
public int getTimezoneOffset()(Code)(Java Doc)
public int getYear()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
public static long parse(String s)(Code)(Java Doc)
public void setDate(int date)(Code)(Java Doc)
public void setHours(int hours)(Code)(Java Doc)
public void setMinutes(int minutes)(Code)(Java Doc)
public void setMonth(int month)(Code)(Java Doc)
public void setSeconds(int seconds)(Code)(Java Doc)
public void setTime(long time)(Code)(Java Doc)
public void setYear(int year)(Code)(Java Doc)
public String toGMTString()(Code)(Java Doc)
public String toLocaleString()(Code)(Java Doc)
public String toString()(Code)(Java Doc)

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.