I have a list of insert sql strings throw mysqldump. E.g.
INSERT INTO table (id, name) VALUES (1, 'wow');
INSERT INTO table (id, name) VALUES (2, 'yeah');
I want to import this sql to another service, and add 10 to each sql's id.
I know PreparedStatement in java.sql can set parameter to sql like this:
INSERT INTO table (id, name) VALUES (?, ?);
But how to analyze an existing sql, get and replace a parameter in Java?
INSERT INTO table (id, name) VALUES (10 + ?, ?);?update table set id = id +10