【发布时间】:2020-05-22 05:42:32
【问题描述】:
我已经连接到数据库
props.setProperty("user", login);
props.setProperty("password", password);
props.setProperty("reWriteBatchedInserts", "true");
PreparedStatement
ps = connection.prepareStatement(sqlStr);
//...
psRegion.addBatch();
我怎样才能从 statemrnt 获得完整的请求?如果我尝试System.out.println(ps);,我只能使用最后添加的参数进行查询。
我需要得到insert into a.a(x,y) values (x1,y1), (x2,y2), ...;
【问题讨论】:
-
重写可能发生在驱动程序代码的更深处,为什么你认为你需要得到它?如果您只想记录日志,则应该使用
println()的其他内容。 -
这能回答你的问题吗? Get query from java.sql.PreparedStatement
标签: java postgresql