Unverified 提交 145b71b5 authored 作者: Noel Grandin's avatar Noel Grandin 提交者: GitHub

Merge pull request #856 from katzyn/tests

Fix TestDateTimeUtils.testDayOfWeek() and example with ANY(?)
...@@ -490,7 +490,7 @@ Instead, use a prepared statement with arrays as in the following example: ...@@ -490,7 +490,7 @@ Instead, use a prepared statement with arrays as in the following example:
</p> </p>
<pre> <pre>
PreparedStatement prep = conn.prepareStatement( PreparedStatement prep = conn.prepareStatement(
"SELECT * TEST.ID = ANY(?)"); "SELECT * FROM TEST WHERE ID = ANY(?)");
prep.setObject(1, new Object[] { "1", "2" }); prep.setObject(1, new Object[] { "1", "2" });
ResultSet rs = prep.executeQuery(); ResultSet rs = prep.executeQuery();
</pre> </pre>
......
...@@ -45,7 +45,7 @@ public class TestDateTimeUtils extends TestBase { ...@@ -45,7 +45,7 @@ public class TestDateTimeUtils extends TestBase {
* {@link DateTimeUtils#getIsoDayOfWeek(long)}. * {@link DateTimeUtils#getIsoDayOfWeek(long)}.
*/ */
private void testDayOfWeek() { private void testDayOfWeek() {
GregorianCalendar gc = DateTimeUtils.createGregorianCalendar(); GregorianCalendar gc = DateTimeUtils.createGregorianCalendar(DateTimeUtils.UTC);
for (int i = -1_000_000; i <= 1_000_000; i++) { for (int i = -1_000_000; i <= 1_000_000; i++) {
gc.clear(); gc.clear();
gc.setTimeInMillis(i * 86400000L); gc.setTimeInMillis(i * 86400000L);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论