37 |
|
|
38 |
package java.sql; |
package java.sql; |
39 |
|
|
40 |
|
import java.text.ParseException; |
41 |
import java.text.SimpleDateFormat; |
import java.text.SimpleDateFormat; |
42 |
|
|
43 |
/** |
/** |
83 |
} |
} |
84 |
|
|
85 |
/** |
/** |
86 |
|
* This method always throws an IllegalArgumentException. |
87 |
|
* |
88 |
|
* @throws IllegalArgumentException when it's called. |
89 |
|
* @deprecated |
90 |
|
*/ |
91 |
|
public int getHours() throws IllegalArgumentException { |
92 |
|
throw new IllegalArgumentException(); |
93 |
|
} |
94 |
|
|
95 |
|
/** |
96 |
|
* This method always throws an IllegalArgumentException. |
97 |
|
* |
98 |
|
* @throws IllegalArgumentException when it's called. |
99 |
|
* @deprecated |
100 |
|
*/ |
101 |
|
public int getMinutes() throws IllegalArgumentException { |
102 |
|
throw new IllegalArgumentException(); |
103 |
|
} |
104 |
|
|
105 |
|
/** |
106 |
|
* This method always throws an IllegalArgumentException. |
107 |
|
* |
108 |
|
* @throws IllegalArgumentException when it's called. |
109 |
|
* @deprecated |
110 |
|
*/ |
111 |
|
public int getSeconds() throws IllegalArgumentException { |
112 |
|
throw new IllegalArgumentException(); |
113 |
|
} |
114 |
|
|
115 |
|
/** |
116 |
|
* This method always throws an IllegalArgumentException. |
117 |
|
* |
118 |
|
* @throws IllegalArgumentException when it's called. |
119 |
|
* @deprecated |
120 |
|
*/ |
121 |
|
public void setHours(int newValue) throws IllegalArgumentException { |
122 |
|
throw new IllegalArgumentException(); |
123 |
|
} |
124 |
|
|
125 |
|
/** |
126 |
|
* This method always throws an IllegalArgumentException. |
127 |
|
* |
128 |
|
* @throws IllegalArgumentException when it's called. |
129 |
|
* @deprecated |
130 |
|
*/ |
131 |
|
public void setMinutes(int newValue) throws IllegalArgumentException { |
132 |
|
throw new IllegalArgumentException(); |
133 |
|
} |
134 |
|
|
135 |
|
/** |
136 |
|
* This method always throws an IllegalArgumentException. |
137 |
|
* |
138 |
|
* @throws IllegalArgumentException when it's called. |
139 |
|
* @deprecated |
140 |
|
*/ |
141 |
|
public void setSeconds(int newValue) throws IllegalArgumentException { |
142 |
|
throw new IllegalArgumentException(); |
143 |
|
} |
144 |
|
|
145 |
|
/** |
146 |
* This method returns a new instance of this class by parsing a |
* This method returns a new instance of this class by parsing a |
147 |
* date in JDBC format into a Java date. |
* date in JDBC format into a Java date. |
148 |
* |
* |
153 |
*/ |
*/ |
154 |
public static Date valueOf (String str) |
public static Date valueOf (String str) |
155 |
{ |
{ |
156 |
try |
try |
157 |
{ |
{ |
158 |
java.util.Date d = (java.util.Date) sdf.parseObject(str); |
java.util.Date d = (java.util.Date) sdf.parseObject(str); |
159 |
return(new Date(d.getTime())); |
|
160 |
|
if (d == null) { |
161 |
|
throw new IllegalArgumentException(str); |
162 |
|
} |
163 |
|
else { |
164 |
|
return(new Date(d.getTime())); |
165 |
|
} |
166 |
} |
} |
167 |
catch(Exception e) |
catch (ParseException e) |
168 |
{ |
{ |
169 |
return(null); |
throw new IllegalArgumentException(str); |
170 |
} |
} |
171 |
} |
} |
172 |
|
|