asSql method is removed from ClientPreparedStatement mysql-connector-java and mysql-connector-j

0 votes

ClientPreparedStatement had a public method in the mysql-connector-java library called asSql() that I found to be quite helpful, however it was deleted in April of this year, and the code passed over to the mysql-connector-j project. I used it in a QueryInterceptor so that I could give AWS X-ray subsegments a name that made sense. I can immediately identify any lengthy searches in my AWS lambda function by looking at the X-ray trace and labelling each subsegment with the start of each query. As I attempted to update my programme today to mysql-connector-j, or at the very least the most recent version of mysql-connector-java, I discovered that the asSql() function on ClientPreparedStatement no longer existed.

I went back through the mysql-connector-java releases and discovered that the function was included in the 8.0.28 jar (Jan. 17, 2022) but eliminated in the 8.0.29 version (Apr 25, 2022). To my knowledge, it was never marked as deprecated.


I discovered that by using ClientPreparedStatement.toString(), I was able to retrieve the same query with the addition of "com.mysql.cj.jdbc.ClientPreparedStatement: ". Of course, I could have removed this, but doing so would have resulted in a tight coupling of my app to a feature that might change in a later release. So, I'd prefer not take this on.

Is there any way to use a ClientPreparedStatement's asSql() functionality?

Dec 20, 2022 in AWS by Tejashwini
• 3,820 points
279 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In AWS

0 votes
2 answers
+1 vote
1 answer

Is There any Connector from IBM MQ to Kinesis

The AWS documentation does not explicitly mention that ...READ MORE

answered Oct 30, 2019 in AWS by Tanmay
2,044 views
0 votes
2 answers

Receiving SMS from users and stores in AWS

As far as I know, receiving international ...READ MORE

answered Aug 21, 2018 in AWS by Priyaj
• 58,090 points
1,285 views
0 votes
1 answer

java.lang.classnotfoundexception: com.mysql.jdbc.driver

I assume that your mysql connectivity library ...READ MORE

answered Feb 8, 2022 in Java by Soham
• 9,700 points
7,057 views
0 votes
1 answer

Java.lang.ClassNotFoundException: com.mysql.jdbc.Driver in Eclipse

Just follow these two steps: Step 1 Add This ...READ MORE

answered Apr 29, 2022 in Other DevOps Questions by narikkadan
• 63,420 points
2,258 views
+5 votes
4 answers

How to execute a python file with few arguments in java?

You can use Java Runtime.exec() to run python script, ...READ MORE

answered Mar 27, 2018 in Java by DragonLord999
• 8,450 points

edited Nov 7, 2018 by Omkar 79,311 views
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
7,921 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP