Skip to content

Commit

Permalink
Debugging the skipped connection
Browse files Browse the repository at this point in the history
  • Loading branch information
SiddharthBITS committed Jan 23, 2025
1 parent b1b31ca commit 3228283
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions test/JDBC/src/main/java/com/sqlsamples/JDBCCrossDialect.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,36 +164,31 @@ Connection getPsqlConnection (String strLine, BufferedWriter bw, Logger logger)

void closeConnectionsUtil (HashMap<String, Connection> connectionMap, BufferedWriter bw, Logger logger)
{
//boolean needSkipFirst = (majorVersion > 16) || (majorVersion == 16 && minorVersion >= 6) ? true : false;
boolean needSkipFirst = (majorVersion > 16) || (majorVersion == 16 && minorVersion >= 6) ? true : false;
Iterator<Map.Entry<String, Connection>> iterator = connectionMap.entrySet().iterator();

while (iterator.hasNext())
{
Map.Entry<String, Connection> entry = iterator.next();
Connection connection = entry.getValue();

try
if (!needSkipFirst)
{
connection.close();
}
catch (SQLException e)
try
{
connection.close();
} catch (SQLException e) {
handleSQLExceptionWithFile(e, bw, logger);
}
}
else
{
handleSQLExceptionWithFile(e, bw, logger);
System.out.println();
System.out.println("---------------------------------------------");
System.out.println(entry);
System.out.println("---------------------------------------------");
System.out.println();
needSkipFirst = false;
}

// if (!needSkipFirst)
// {
// try
// {
// connection.close();
// } catch (SQLException e) {
// handleSQLExceptionWithFile(e, bw, logger);
// }
// }
// else
// {
// needSkipFirst = false;
// }
}
}

Expand Down

0 comments on commit 3228283

Please sign in to comment.