From: Marco Zanon Date: Tue, 22 Aug 2017 22:18:21 +0000 (+0000) Subject: Added a parameter to allow forcing localTypesMode to on/off at runtime. X-Git-Tag: 6.2.0~1 X-Git-Url: https://gitweb.marcozanon.com/?a=commitdiff_plain;h=5be8192944d0d248112b0c0327c9ae85afdd81ff;p=Macaco Added a parameter to allow forcing localTypesMode to on/off at runtime. --- diff --git a/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java b/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java index 01e2489..5c05e2a 100644 --- a/src/java/com/marcozanon/macaco/database/MDatabaseConnection.java +++ b/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) {