public class PreparedStatementClassReplacement extends Object implements MethodReplacementClass
CONSUME_INSTANCE_METHOD_NAME| Constructor and Description |
|---|
PreparedStatementClassReplacement() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
execute(PreparedStatement stmt) |
static ResultSet |
executeQuery(PreparedStatement stmt) |
static int |
executeUpdate(PreparedStatement stmt) |
static String |
extractSqlFromH2PreparedStatement(PreparedStatement stmt) |
Class<?> |
getTargetClass() |
static String |
interpolateSqlString(String sql,
List<String> params)
Deprecated.
|
static String |
interpolateSqlStringWithJSqlParser(String sql,
List<String> params)
inspired by this example from https://stackoverflow.com/questions/46890089/how-can-i-purify-a-sql-query-and-replace-all-parameters-with-using-regex
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTargetClass, getTargetClassName, isAvailablepublic Class<?> getTargetClass()
getTargetClass in interface MethodReplacementClasspublic static String extractSqlFromH2PreparedStatement(PreparedStatement stmt)
@Deprecated public static String interpolateSqlString(String sql, List<String> params)
public static String interpolateSqlStringWithJSqlParser(String sql, List<String> params)
sql - is an original sql command which might contain comments or be dynamic sql with parametersparams - are parameters which exists in the [sql]public static ResultSet executeQuery(PreparedStatement stmt) throws SQLException
SQLExceptionpublic static int executeUpdate(PreparedStatement stmt) throws SQLException
SQLExceptionpublic static boolean execute(PreparedStatement stmt) throws SQLException
SQLExceptionCopyright © 2016–2024. All rights reserved.