From 22b7e65cafcce33a5955f20882f99b631d92def5 Mon Sep 17 00:00:00 2001 From: Marco Zanon Date: Tue, 22 Aug 2017 22:18:21 +0000 Subject: [PATCH] Added a parameter to allow forcing localTypesMode to on/off at runtime. --- .../marcozanon/macaco/database/MDatabaseConnection.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/6.x/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java b/6.x/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java index 01e2489..5c05e2a 100644 --- a/6.x/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java +++ b/6.x/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java @@ -226,10 +226,14 @@ public class MDatabaseConnection extends MObject { /* Statements. */ public MSqlStatementResults executePreparedStatement(String statement) throws MDatabaseConnectionFailureException, MSqlStatementException { - return this.executePreparedStatement(statement, new LinkedList()); + return this.executePreparedStatement(statement, new LinkedList(), this.getLocalTypesMode()); } public MSqlStatementResults executePreparedStatement(String statement, LinkedList parameters) throws MDatabaseConnectionFailureException, MSqlStatementException { + return this.executePreparedStatement(statement, parameters, this.getLocalTypesMode()); + } + + public MSqlStatementResults executePreparedStatement(String statement, LinkedList parameters, boolean localTypesMode) throws MDatabaseConnectionFailureException, MSqlStatementException { if (MText.isBlank(statement)) { throw new IllegalArgumentException("Invalid 'statement': null or empty."); } @@ -254,7 +258,7 @@ public class MDatabaseConnection extends MObject { } // Execute the statement and parse the results. preparedStatement.execute(); - results = new MSqlStatementResults(preparedStatement, this.getLocalTypesMode()); + results = new MSqlStatementResults(preparedStatement, localTypesMode); this.logStatement(preparedStatement.toString()); } catch (SQLException exception) { -- 2.30.2