开发者

How to get the Query executed using ResultSet?

开发者 https://www.devze.com 2023-01-25 13:21 出处:网络
I have a preparedStatement called PrepStatement which contains a Select Query like Select a, b from abc where ab=\"cd\".

I have a preparedStatement called PrepStatement which contains a Select Query like

Select a, b from abc where ab="cd".

executed below

ResultSet 开发者_运维知识库selectParams = PrepStatement.executeQuery();

Is there anyway i can get the executed Query with parameters passed from ResultSet object?

I can get it from PrepStatement object, But i want to get it from ResultSet or ResultSetMetadata.


You can't get it from any of those actually.

Hard to see why you're even asking, when you already have a solution: getting it from the PreparedStatement.


resultSet.getStatement() should give u the query and some extra information

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号