Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/389.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/postgresql/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 是否可以从preparedStatement获取完整请求?_Java_Postgresql - Fatal编程技术网

Java 是否可以从preparedStatement获取完整请求?

Java 是否可以从preparedStatement获取完整请求?,java,postgresql,Java,Postgresql,我已连接到数据库 props.setProperty("user", login); props.setProperty("password", password); props.setProperty("reWriteBatchedInserts", "true"); 准备好的报表 ps = connection.prepareStatement(sqlStr); //... psRegion.addBatch();

我已连接到数据库

    props.setProperty("user", login);
    props.setProperty("password", password);
    props.setProperty("reWriteBatchedInserts", "true");
准备好的报表

        ps = connection.prepareStatement(sqlStr);
        //...
        psRegion.addBatch();
如何从statemrnt获取完整请求?如果我尝试
System.out.println(ps)我只有最后添加参数的查询


我需要将
插入a.a(x,y)值(x1,y1),(x2,y2)

Amongalen的评论为您指出了一般答案,但在PostgreSQL中,您有时可以通过查询系统目录找到答案

我说“有时”,因为默认情况下,JDBC驱动程序不会立即创建服务器端准备的语句,只有在语句执行5次以上时才会创建


有关详细信息,请参阅。

重写可能发生在驱动程序代码的更深处,您认为为什么需要得到它?如果您只想记录日志,那么应该使用
println()
的其他工具来完成。这是否回答了您的问题?