Skip to content

Commit

Permalink
fix: fix issue in the code
Browse files Browse the repository at this point in the history
(cherry picked from commit d4c623b)
  • Loading branch information
befc authored and smmribeiro committed Dec 9, 2024
1 parent d5e5bab commit 1220f1f
Showing 1 changed file with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ private static void handleTestConnection( Properties props, String connectionNam
/**
* Allows the native SQL Connection to be enhanced in a subclass. Best used when a connection needs to be enhanced
* with an "effective user"
*
*
* @param connection
*/
protected void enhanceConnection( Connection connection ) throws SQLException {
Expand All @@ -275,7 +275,7 @@ protected void enhanceConnection( Connection connection ) throws SQLException {
/**
* Allows enhancements to the native SQL Connection to be removed in a subclass. Best used when a connection needs to
* be enhanced with an "effective user"
*
*
* @param connection
*/
protected void unEnhanceConnection( Connection connection ) throws SQLException {
Expand All @@ -284,7 +284,7 @@ protected void unEnhanceConnection( Connection connection ) throws SQLException
/**
* Allow wrapping/proxying of the native SQL connection by a subclass. Best used when a connection needs to be be
* enhanced or proxied for Single Signon or possibly tenanting.
*
*
* @param connection
* @return
*/
Expand All @@ -295,7 +295,7 @@ protected Connection captureConnection( Connection connection ) throws SQLExcept
/**
* Allows the native SQL Statement to be enhanced by a subclass. Examples may be to allow additional information like
* a user to be bound to the statement.
*
*
* @param statement
*/
protected void enhanceStatement( Statement statement ) throws SQLException {
Expand Down Expand Up @@ -323,9 +323,7 @@ private void closeStatements() {
* iterate over and close all resultsets. Remove each result set from the list.
*/
private void closeResultSets() {
private static boolean isTestConnection( String connectionName ) {
return connectionName.length() > 12 && connectionName.startsWith( "__TEST__" ) && connectionName.endsWith( "__TEST__" );
} Iterator iter = resultSets.iterator();
Iterator iter = resultSets.iterator();
while ( iter.hasNext() ) {
IPentahoResultSet rset = (IPentahoResultSet) iter.next();
if ( rset != null ) {
Expand Down Expand Up @@ -368,7 +366,7 @@ public void close() {

/*
* (non-Javadoc)
*
*
* @see org.pentaho.connection.IPentahoConnection#getLastQuery()
*/
public String getLastQuery() {
Expand All @@ -377,7 +375,7 @@ public String getLastQuery() {

/**
* Executes the specified query.
*
*
* @param query
* the query to execute
* @return the resultset from the query
Expand All @@ -394,7 +392,7 @@ public IPentahoResultSet executeQuery( final String query ) throws SQLException,

/**
* Executes the specified query with the defined parameters
*
*
* @param query
* the query to be executed
* @param scrollType
Expand Down Expand Up @@ -462,7 +460,7 @@ public IPentahoResultSet prepareAndExecuteQuery( final String query, final List
* The purpose of this method is to set limitations such as fetchSize and maxrows on the provided statement. If the
* JDBC driver does not support the setting and throws an Exception, we will re-throw iff the limit was explicitly
* set.
*
*
* @param stmt
* Either a Statement or PreparedStatement
* @throws SQLException
Expand Down Expand Up @@ -577,7 +575,7 @@ public boolean preparedQueriesSupported() {

/*
* (non-Javadoc)
*
*
* @see org.pentaho.connection.IPentahoConnection#isClosed()
*/
public boolean isClosed() {
Expand All @@ -592,9 +590,9 @@ public boolean isClosed() {

/*
* (non-Javadoc)
*
*
* @see org.pentaho.connection.IPentahoConnection#isReadOnly()
*
*
* Right now this architecture only support selects (read only)
*/
public boolean isReadOnly() {
Expand Down

0 comments on commit 1220f1f

Please sign in to comment.