我尝试过使用Base.exec
/ new DB("default").exec("refresh materialized view concurrently ...
,但都没有效果。没有错误,但声明没有运行。
答案 0 :(得分:0)
终于弄明白了。不确定原因,但Base.exec
不起作用,只有Statement.executeUpdate
。
// Open your connection
String sql = "refresh materialized view concurrently MY_VIEW";
try {
Connection conn = new DB("default").connection();
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);
conn.commit();
stmt.close();
} catch (SQLException e) {
e.printStackTrace();
}