tdf#167495 Base need to close ResultSet after using it.

Change-Id: I02622911370b9929cbca66228a879fcdcb0f866e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189332
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
This commit is contained in:
prrvchr
2025-08-11 15:08:53 +02:00
committed by Noel Grandin
parent 043a76a06a
commit 3324db4d03
@@ -20,6 +20,7 @@ package com.sun.star.wizards.db;
import java.util.ArrayList;
import com.sun.star.sdbc.SQLException;
import com.sun.star.sdbc.XCloseable;
import com.sun.star.sdbc.XResultSet;
import com.sun.star.sdbc.XRow;
import com.sun.star.uno.UnoRuntime;
@@ -65,6 +66,11 @@ public class RelationController extends CommandName
CommandName oCommandName = new CommandName(getCommandMetaData(), sForeignCatalog, sForeignScheme, sForeignTableName, false);
aReferencedTableVector.add(oCommandName.getComposedName());
}
XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xResultSet);
if (xCloseable != null)
{
xCloseable.close();
}
sReferencedTableNames = new String[aReferencedTableVector.size()];
aReferencedTableVector.toArray(sReferencedTableNames);
}
@@ -130,6 +136,11 @@ public class RelationController extends CommandName
}
}
XCloseable xCloseable = UnoRuntime.queryInterface(XCloseable.class, xResultSet);
if (xCloseable != null)
{
xCloseable.close();
}
sKeyColumnNames = new String[2][aMasterFieldNamesVector.size()];
sKeyColumnNames[0] = new String[aSlaveFieldNamesVector.size()];
sKeyColumnNames[1] = new String[aMasterFieldNamesVector.size()];