提交 23b10725 authored 作者: Thomas Mueller's avatar Thomas Mueller

Test.

上级 70bb094b
...@@ -149,18 +149,23 @@ public class TestDateStorage extends TestBase { ...@@ -149,18 +149,23 @@ public class TestDateStorage extends TestBase {
private void test(PreparedStatement prep, int d) throws SQLException { private void test(PreparedStatement prep, int d) throws SQLException {
String s = "2040-10-" + ("" + d).substring(1); String s = "2040-10-" + ("" + d).substring(1);
// some dates don't work in some versions of Java // some dates don't work in some versions of Java
// java.sql.Date date = java.sql.Date.valueOf(s); // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6772689
// long time = date.getTime(); java.sql.Date date = java.sql.Date.valueOf(s);
// int plus = 0; long time = date.getTime();
// while (true) { int plus = 0;
// date = new java.sql.Date(time); while (true) {
// String x = date.toString(); date = new java.sql.Date(time);
// if (x.equals(s)) { String x = date.toString();
// break; if (x.equals(s)) {
// } break;
// time += 1000; }
// plus += 1000; time += 1000;
// } plus += 1000;
}
// if (!date.toString().equals(s)) {
// println(TimeZone.getDefault().getDisplayName() + " " + s + " <> " + date.toString());
// return;
// }
prep.setString(1, s); prep.setString(1, s);
ResultSet rs = prep.executeQuery(); ResultSet rs = prep.executeQuery();
rs.next(); rs.next();
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论