MySQL Forums
Forum List  »  Connector/C++

How to escape a string?
Posted by: Steve Yates
Date: May 24, 2021 03:40PM

Connector/C++ 8.0.25 (Legacy JDBC API)

How do I escape a string without using a PreparedStatement and setString(index, value)?

All the other mysql connectors seem to have a 'mysql_real_escape_string' type function. I can not seem to find anything similar with Connector/C++.

The issue with using a PreparedStatement and setString() is our code currently can issue one insert statement with multiple insert rows. Inserting each row one insert at a time will slow down our processing.

Note: I'm in the middle of migrating our code from Connector/C & MySQL++ to Connector/C++. We are upgrading to a new server with MySQL 8.0. And as far as I have found, the Windows version of Connector/C only goes up to 6.1.11. At least via the MySQL installer and the MySQL download page. And Connector/C 6.1.11 can not authenticate against a MySQL 8.0 db without enabling legacy authentication. And we are trying to avoid that.

Options: ReplyQuote


Subject
Views
Written By
Posted
How to escape a string?
854
May 24, 2021 03:40PM
417
May 24, 2021 04:00PM
374
May 24, 2021 04:06PM
326
May 24, 2021 06:20PM
315
June 01, 2021 03:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.