[Libreoffice-commits] core.git: connectivity/IwyuFilter_connectivity.yaml connectivity/qa connectivity/source

Gabor Kelemen (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 14 09:22:32 UTC 2020


 connectivity/IwyuFilter_connectivity.yaml                               |   71 ++++++++++
 connectivity/qa/connectivity/mork/DriverTest.cxx                        |    4 
 connectivity/source/commontools/CommonTools.cxx                         |    7 
 connectivity/source/commontools/ConnectionWrapper.cxx                   |    4 
 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx          |    9 -
 connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx  |    5 
 connectivity/source/commontools/FValue.cxx                              |    1 
 connectivity/source/commontools/RowFunctionParser.cxx                   |    2 
 connectivity/source/commontools/TColumnsHelper.cxx                      |    5 
 connectivity/source/commontools/TConnection.cxx                         |    1 
 connectivity/source/commontools/TIndexColumns.cxx                       |    2 
 connectivity/source/commontools/TKeyColumns.cxx                         |    2 
 connectivity/source/commontools/TTableHelper.cxx                        |    4 
 connectivity/source/commontools/dbconversion.cxx                        |    1 
 connectivity/source/commontools/dbexception.cxx                         |    1 
 connectivity/source/commontools/dbmetadata.cxx                          |    1 
 connectivity/source/commontools/dbtools.cxx                             |    2 
 connectivity/source/commontools/dbtools2.cxx                            |    2 
 connectivity/source/commontools/filtermanager.cxx                       |    1 
 connectivity/source/commontools/formattedcolumnvalue.cxx                |    1 
 connectivity/source/commontools/parameters.cxx                          |    2 
 connectivity/source/commontools/sqlerror.cxx                            |    1 
 connectivity/source/cpool/ZConnectionPool.cxx                           |    2 
 connectivity/source/cpool/ZConnectionWrapper.cxx                        |    4 
 connectivity/source/cpool/ZPooledConnection.cxx                         |    3 
 connectivity/source/drivers/calc/CConnection.cxx                        |    2 
 connectivity/source/drivers/calc/CDatabaseMetaData.cxx                  |    7 
 connectivity/source/drivers/calc/CTable.cxx                             |   10 -
 connectivity/source/drivers/calc/CTables.cxx                            |    1 
 connectivity/source/drivers/component/CColumns.cxx                      |    1 
 connectivity/source/drivers/component/CDatabaseMetaData.cxx             |    6 
 connectivity/source/drivers/component/CResultSet.cxx                    |    1 
 connectivity/source/drivers/component/CTable.cxx                        |   26 ---
 connectivity/source/drivers/dbase/DColumns.cxx                          |    1 
 connectivity/source/drivers/dbase/DConnection.cxx                       |    1 
 connectivity/source/drivers/dbase/DDatabaseMetaData.cxx                 |    3 
 connectivity/source/drivers/dbase/DIndex.cxx                            |    4 
 connectivity/source/drivers/dbase/DIndexColumns.cxx                     |    1 
 connectivity/source/drivers/dbase/DResultSet.cxx                        |    1 
 connectivity/source/drivers/dbase/DTable.cxx                            |    7 
 connectivity/source/drivers/dbase/DTables.cxx                           |    5 
 connectivity/source/drivers/dbase/dindexnode.cxx                        |    2 
 connectivity/source/drivers/evoab2/NColumns.cxx                         |    2 
 connectivity/source/drivers/evoab2/NConnection.cxx                      |    1 
 connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx                |    4 
 connectivity/source/drivers/evoab2/NDriver.cxx                          |    5 
 connectivity/source/drivers/evoab2/NPreparedStatement.cxx               |    4 
 connectivity/source/drivers/evoab2/NResultSet.cxx                       |    7 
 connectivity/source/drivers/evoab2/NResultSetMetaData.cxx               |    1 
 connectivity/source/drivers/evoab2/NStatement.cxx                       |    1 
 connectivity/source/drivers/evoab2/NTable.cxx                           |    2 
 connectivity/source/drivers/evoab2/NTables.cxx                          |    8 -
 connectivity/source/drivers/file/FColumns.cxx                           |    2 
 connectivity/source/drivers/file/FConnection.cxx                        |    4 
 connectivity/source/drivers/file/FDatabaseMetaData.cxx                  |    5 
 connectivity/source/drivers/file/FDriver.cxx                            |    1 
 connectivity/source/drivers/file/FPreparedStatement.cxx                 |    2 
 connectivity/source/drivers/file/FResultSet.cxx                         |    8 -
 connectivity/source/drivers/file/FStatement.cxx                         |    2 
 connectivity/source/drivers/file/FTable.cxx                             |    2 
 connectivity/source/drivers/file/FTables.cxx                            |    7 
 connectivity/source/drivers/file/fanalyzer.cxx                          |    1 
 connectivity/source/drivers/file/fcode.cxx                              |    3 
 connectivity/source/drivers/file/fcomp.cxx                              |    1 
 connectivity/source/drivers/firebird/Blob.cxx                           |    3 
 connectivity/source/drivers/firebird/Clob.cxx                           |    4 
 connectivity/source/drivers/firebird/Column.cxx                         |    1 
 connectivity/source/drivers/firebird/Columns.cxx                        |    2 
 connectivity/source/drivers/firebird/Connection.cxx                     |    7 
 connectivity/source/drivers/firebird/DatabaseMetaData.cxx               |    1 
 connectivity/source/drivers/firebird/PreparedStatement.cxx              |    3 
 connectivity/source/drivers/firebird/ResultSet.cxx                      |    5 
 connectivity/source/drivers/firebird/Statement.cxx                      |    8 -
 connectivity/source/drivers/firebird/StatementCommonBase.cxx            |    1 
 connectivity/source/drivers/firebird/Users.cxx                          |    4 
 connectivity/source/drivers/firebird/Util.cxx                           |    1 
 connectivity/source/drivers/flat/EColumns.cxx                           |    1 
 connectivity/source/drivers/flat/EConnection.cxx                        |    1 
 connectivity/source/drivers/flat/EDatabaseMetaData.cxx                  |    5 
 connectivity/source/drivers/flat/EResultSet.cxx                         |    1 
 connectivity/source/drivers/flat/ETable.cxx                             |    9 -
 connectivity/source/drivers/flat/ETables.cxx                            |    6 
 connectivity/source/drivers/hsqldb/HConnection.cxx                      |    1 
 connectivity/source/drivers/hsqldb/HDriver.cxx                          |    4 
 connectivity/source/drivers/hsqldb/HStorageAccess.cxx                   |    2 
 connectivity/source/drivers/hsqldb/HStorageMap.cxx                      |    1 
 connectivity/source/drivers/hsqldb/HTable.cxx                           |   11 -
 connectivity/source/drivers/hsqldb/HTables.cxx                          |    5 
 connectivity/source/drivers/hsqldb/HUsers.cxx                           |    4 
 connectivity/source/drivers/hsqldb/HView.cxx                            |    1 
 connectivity/source/drivers/hsqldb/HViews.cxx                           |    8 -
 connectivity/source/drivers/hsqldb/StorageFileAccess.cxx                |    2 
 connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx         |    5 
 connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx        |   10 -
 connectivity/source/drivers/jdbc/Array.cxx                              |    2 
 connectivity/source/drivers/jdbc/Blob.cxx                               |    1 
 connectivity/source/drivers/jdbc/Class.cxx                              |    1 
 connectivity/source/drivers/jdbc/DatabaseMetaData.cxx                   |    1 
 connectivity/source/drivers/jdbc/Date.cxx                               |    2 
 connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx                 |    5 
 connectivity/source/drivers/jdbc/InputStream.cxx                        |    1 
 connectivity/source/drivers/jdbc/JConnection.cxx                        |    3 
 connectivity/source/drivers/jdbc/JDriver.cxx                            |    5 
 connectivity/source/drivers/jdbc/JStatement.cxx                         |    1 
 connectivity/source/drivers/jdbc/Object.cxx                             |    3 
 connectivity/source/drivers/jdbc/Ref.cxx                                |    2 
 connectivity/source/drivers/jdbc/ResultSetMetaData.cxx                  |    1 
 connectivity/source/drivers/jdbc/SQLException.cxx                       |    3 
 connectivity/source/drivers/jdbc/Throwable.cxx                          |    2 
 connectivity/source/drivers/jdbc/tools.cxx                              |    3 
 connectivity/source/drivers/mork/MColumnAlias.cxx                       |    4 
 connectivity/source/drivers/mork/MColumns.cxx                           |    1 
 connectivity/source/drivers/mork/MDatabaseMetaData.cxx                  |    2 
 connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx            |    9 -
 connectivity/source/drivers/mork/MQueryHelper.cxx                       |    3 
 connectivity/source/drivers/mork/MResultSetMetaData.cxx                 |    2 
 connectivity/source/drivers/mork/MorkParser.cxx                         |    3 
 connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx       |    1 
 connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx              |    2 
 connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx            |    2 
 connectivity/source/drivers/mysql_jdbc/YTable.cxx                       |    9 -
 connectivity/source/drivers/mysql_jdbc/YTables.cxx                      |    5 
 connectivity/source/drivers/mysql_jdbc/YUsers.cxx                       |    4 
 connectivity/source/drivers/mysql_jdbc/YViews.cxx                       |    8 -
 connectivity/source/drivers/mysqlc/mysqlc_connection.cxx                |   13 -
 connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx          |   11 -
 connectivity/source/drivers/mysqlc/mysqlc_driver.cxx                    |    2 
 connectivity/source/drivers/mysqlc/mysqlc_general.cxx                   |    3 
 connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx        |    5 
 connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx         |    2 
 connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx                 |    9 -
 connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx         |    2 
 connectivity/source/drivers/mysqlc/mysqlc_services.cxx                  |    1 
 connectivity/source/drivers/mysqlc/mysqlc_statement.cxx                 |    9 -
 connectivity/source/drivers/mysqlc/mysqlc_types.cxx                     |    1 
 connectivity/source/drivers/odbc/OConnection.cxx                        |    4 
 connectivity/source/drivers/odbc/ODatabaseMetaData.cxx                  |    2 
 connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx         |    5 
 connectivity/source/drivers/odbc/ODriver.cxx                            |    1 
 connectivity/source/drivers/odbc/OFunctions.cxx                         |    1 
 connectivity/source/drivers/odbc/OPreparedStatement.cxx                 |    4 
 connectivity/source/drivers/odbc/OResultSet.cxx                         |    2 
 connectivity/source/drivers/odbc/OStatement.cxx                         |    1 
 connectivity/source/drivers/odbc/OTools.cxx                             |    2 
 connectivity/source/drivers/postgresql/pq_array.cxx                     |    2 
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx             |   10 -
 connectivity/source/drivers/postgresql/pq_connection.cxx                |    3 
 connectivity/source/drivers/postgresql/pq_databasemetadata.cxx          |    3 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx         |    4 
 connectivity/source/drivers/postgresql/pq_sequenceresultsetmetadata.cxx |    1 
 connectivity/source/drivers/postgresql/pq_statement.cxx                 |    6 
 connectivity/source/drivers/postgresql/pq_statics.cxx                   |    2 
 connectivity/source/drivers/postgresql/pq_tools.cxx                     |    2 
 connectivity/source/drivers/postgresql/pq_updateableresultset.cxx       |    1 
 connectivity/source/drivers/postgresql/pq_xbase.cxx                     |    3 
 connectivity/source/drivers/postgresql/pq_xcolumn.cxx                   |    2 
 connectivity/source/drivers/postgresql/pq_xcolumns.cxx                  |    3 
 connectivity/source/drivers/postgresql/pq_xcontainer.cxx                |    1 
 connectivity/source/drivers/postgresql/pq_xindex.cxx                    |    4 
 connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx              |    2 
 connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx             |    4 
 connectivity/source/drivers/postgresql/pq_xindexes.cxx                  |    3 
 connectivity/source/drivers/postgresql/pq_xkey.cxx                      |    5 
 connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx                |    2 
 connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx               |    4 
 connectivity/source/drivers/postgresql/pq_xkeys.cxx                     |    1 
 connectivity/source/drivers/postgresql/pq_xtable.cxx                    |    1 
 connectivity/source/drivers/postgresql/pq_xtables.cxx                   |    2 
 connectivity/source/drivers/postgresql/pq_xuser.cxx                     |    1 
 connectivity/source/drivers/postgresql/pq_xusers.cxx                    |    1 
 connectivity/source/drivers/postgresql/pq_xview.cxx                     |    1 
 connectivity/source/manager/mdrivermanager.cxx                          |    1 
 connectivity/source/parse/PColumn.cxx                                   |    2 
 connectivity/source/parse/internalnode.cxx                              |    2 
 connectivity/source/resource/sharedresources.cxx                        |    5 
 connectivity/source/sdbcx/VCatalog.cxx                                  |    1 
 connectivity/source/sdbcx/VCollection.cxx                               |    1 
 connectivity/source/sdbcx/VColumn.cxx                                   |    1 
 connectivity/source/sdbcx/VDescriptor.cxx                               |    1 
 connectivity/source/sdbcx/VGroup.cxx                                    |    3 
 connectivity/source/sdbcx/VIndex.cxx                                    |    2 
 connectivity/source/sdbcx/VKey.cxx                                      |    2 
 connectivity/source/sdbcx/VTable.cxx                                    |    4 
 connectivity/source/sdbcx/VUser.cxx                                     |    4 
 connectivity/source/sdbcx/VView.cxx                                     |    1 
 185 files changed, 91 insertions(+), 591 deletions(-)

New commits:
commit 1dd9200be9f167dc802b04529a54604691fe050e
Author:     Gabor Kelemen <kelemen.gabor2 at nisz.hu>
AuthorDate: Mon Jan 6 23:52:01 2020 +0100
Commit:     Miklos Vajna <vmiklos at collabora.com>
CommitDate: Tue Jan 14 10:21:47 2020 +0100

    tdf#42949 Fix IWYU warnings in connectivity/*/*cxx
    
    Except for platform specific drivers/ado and drivers/macab dirs
    
    Found with bin/find-unneeded-includes
    Only removal proposals are dealt with here.
    
    Change-Id: I24b741cded8995e29ac3d518aeaa0d60b3c55b56
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86317
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

diff --git a/connectivity/IwyuFilter_connectivity.yaml b/connectivity/IwyuFilter_connectivity.yaml
index 422a7e44ca06..7b5cba571001 100644
--- a/connectivity/IwyuFilter_connectivity.yaml
+++ b/connectivity/IwyuFilter_connectivity.yaml
@@ -1,2 +1,73 @@
 ---
 assumeFilename: connectivity/source/commontools/dbtools.cxx
+blacklist:
+    connectivity/source/commontools/ConnectionWrapper.cxx:
+    # Actually used
+    - com/sun/star/beans/PropertyValue.hpp
+    - com/sun/star/sdbc/XConnection.hpp
+    connectivity/source/commontools/RowFunctionParser.cxx:
+    # Boost header needed
+    - boost/spirit/include/classic_core.hpp
+    connectivity/source/commontools/conncleanup.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XRowSet.hpp
+    - com/sun/star/sdbc/XConnection.hpp
+    connectivity/source/commontools/dbconversion.cxx:
+    # Needed for rtl::math::round
+    - rtl/math.hxx
+    connectivity/source/commontools/dbexception.cxx:
+    # Actually used
+    - com/sun/star/sdb/SQLErrorEvent.hpp
+    connectivity/source/commontools/paramwrapper.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XParameters.hpp
+    connectivity/source/commontools/warningscontainer.cxx:
+    # Actually used
+    - com/sun/star/sdb/SQLContext.hpp
+    - com/sun/star/sdbc/XWarningsSupplier.hpp
+    connectivity/source/commontools/predicateinput.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XConnection.hpp
+    connectivity/source/commontools/statementcomposer.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XConnection.hpp
+    connectivity/source/commontools/parameters.cxx:
+    # Actually used
+    - com/sun/star/form/XDatabaseParameterListener.hpp
+    - com/sun/star/sdbc/XParameters.hpp
+    - com/sun/star/task/XInteractionHandler.hpp
+    connectivity/source/cpool/ZPoolCollection.cxx:
+    # Actually used
+    - com/sun/star/beans/PropertyValue.hpp
+    connectivity/source/parse/PColumn.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XResultSetMetaData.hpp
+    connectivity/source/drivers/file/FCatalog.cxx:
+    # Actually used
+    - com/sun/star/sdbc/XRow.hpp
+    connectivity/source/drivers/hsqldb/HStorageAccess.cxx:
+    # Needed for HSQLDB_DBG
+    - accesslog.hxx
+    connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx:
+    # Needed for HSQLDB_DBG
+    - accesslog.hxx
+    connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx:
+    # Needed for HSQLDB_DBG
+    - accesslog.hxx
+    connectivity/source/drivers/jdbc/ConnectionLog.cxx:
+    # Actually used
+    - com/sun/star/util/Date.hpp
+    - com/sun/star/util/Time.hpp
+    - com/sun/star/util/DateTime.hpp
+    connectivity/source/drivers/mork/MorkParser.cxx:
+    # Needed for std::ifstream
+    - fstream
+    connectivity/source/drivers/mork/MDriver.cxx:
+    # Actually used
+    - com/sun/star/uno/XComponentContext.hpp
+    connectivity/source/drivers/mysql_jdbc/YDriver.cxx:
+    # Actually used
+    - com/sun/star/uno/XComponentContext.hpp
+    connectivity/source/drivers/odbc/OTools.cxx:
+    # OSL_BIGENDIAN is being checked
+    - osl/endian.h
diff --git a/connectivity/qa/connectivity/mork/DriverTest.cxx b/connectivity/qa/connectivity/mork/DriverTest.cxx
index f76c05e6d8ba..1ce3b981a238 100644
--- a/connectivity/qa/connectivity/mork/DriverTest.cxx
+++ b/connectivity/qa/connectivity/mork/DriverTest.cxx
@@ -9,10 +9,6 @@
 
 #include <test/bootstrapfixture.hxx>
 
-#include <MColumnAlias.hxx>
-#include <MQueryHelper.hxx>
-#include <MConnection.hxx>
-
 #include <com/sun/star/sdbc/XDriver.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 
diff --git a/connectivity/source/commontools/CommonTools.cxx b/connectivity/source/commontools/CommonTools.cxx
index 615cfe6c582f..a2aeb06af173 100644
--- a/connectivity/source/commontools/CommonTools.cxx
+++ b/connectivity/source/commontools/CommonTools.cxx
@@ -21,17 +21,12 @@
 
 #include <connectivity/CommonTools.hxx>
 #include <connectivity/dbtools.hxx>
-#include <com/sun/star/util/Date.hpp>
-#include <com/sun/star/util/Time.hpp>
-#include <com/sun/star/util/DateTime.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XComponent.hpp>
-#include <cppuhelper/interfacecontainer.h>
-#include <TConnection.hxx>
 #include <com/sun/star/java/JavaVirtualMachine.hpp>
 #if HAVE_FEATURE_JAVA
 #include <jvmaccess/virtualmachine.hxx>
 #endif
+#include <osl/diagnose.h>
 #include <rtl/character.hxx>
 #include <rtl/process.h>
 
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index fba26d8937ae..d7d999058a24 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -19,10 +19,7 @@
 
 #include <connectivity/ConnectionWrapper.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XConnection.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <comphelper/uno3.hxx>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -31,7 +28,6 @@
 #include <cppuhelper/typeprovider.hxx>
 #include <com/sun/star/reflection/ProxyFactory.hpp>
 #include <algorithm>
-#include <string.h>
 
 using namespace connectivity;
 
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 98bc649dd320..d30bd85b4fab 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -21,15 +21,7 @@
 #include <ParameterSubstitution.hxx>
 #include <FDatabaseMetaDataResultSet.hxx>
 #include <FDatabaseMetaDataResultSetMetaData.hxx>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/sequence.hxx>
@@ -37,7 +29,6 @@
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <connectivity/dbexception.hxx>
-#include <strings.hrc>
 #include <TConnection.hxx>
 
 using namespace connectivity;
diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx
index 0d0249f69140..612aee377686 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSetMetaData.cxx
@@ -18,17 +18,12 @@
  */
 
 #include <FDatabaseMetaDataResultSetMetaData.hxx>
-#include <FDatabaseMetaDataResultSet.hxx>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 
 using namespace connectivity;
-using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::sdbcx;
 using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::lang;
 
 ODatabaseMetaDataResultSetMetaData::~ODatabaseMetaDataResultSetMetaData()
diff --git a/connectivity/source/commontools/FValue.cxx b/connectivity/source/commontools/FValue.cxx
index 69f0933ef7cb..828419b3efff 100644
--- a/connectivity/source/commontools/FValue.cxx
+++ b/connectivity/source/commontools/FValue.cxx
@@ -20,7 +20,6 @@
 
 #include <string.h>
 #include <connectivity/FValue.hxx>
-#include <connectivity/CommonTools.hxx>
 #include <connectivity/dbconversion.hxx>
 #include <comphelper/extract.hxx>
 #include <com/sun/star/io/XInputStream.hpp>
diff --git a/connectivity/source/commontools/RowFunctionParser.cxx b/connectivity/source/commontools/RowFunctionParser.cxx
index b970d93f5a9a..e63e0e4a63b7 100644
--- a/connectivity/source/commontools/RowFunctionParser.cxx
+++ b/connectivity/source/commontools/RowFunctionParser.cxx
@@ -31,13 +31,11 @@
 #include <boost/spirit/include/classic_core.hpp>
 #include <RowFunctionParser.hxx>
 #include <rtl/ustring.hxx>
-#include <tools/fract.hxx>
 
 
 #if (OSL_DEBUG_LEVEL > 0)
 #include <iostream>
 #endif
-#include <functional>
 #include <algorithm>
 #include <stack>
 
diff --git a/connectivity/source/commontools/TColumnsHelper.cxx b/connectivity/source/commontools/TColumnsHelper.cxx
index b5f6eba0e160..36061dc2fe3d 100644
--- a/connectivity/source/commontools/TColumnsHelper.cxx
+++ b/connectivity/source/commontools/TColumnsHelper.cxx
@@ -19,13 +19,8 @@
 
 #include <connectivity/TColumnsHelper.hxx>
 #include <connectivity/sdbcx/VColumn.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
 #include <comphelper/types.hxx>
 #include <connectivity/dbtools.hxx>
 #include <TConnection.hxx>
diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
index 255776a3ceb4..134aa5960115 100644
--- a/connectivity/source/commontools/TConnection.cxx
+++ b/connectivity/source/commontools/TConnection.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
 #include <TConnection.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/servicehelper.hxx>
diff --git a/connectivity/source/commontools/TIndexColumns.cxx b/connectivity/source/commontools/TIndexColumns.cxx
index 966db4fc141c..d69358e35489 100644
--- a/connectivity/source/commontools/TIndexColumns.cxx
+++ b/connectivity/source/commontools/TIndexColumns.cxx
@@ -21,8 +21,6 @@
 #include <connectivity/sdbcx/VIndexColumn.hxx>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <connectivity/TIndex.hxx>
 #include <connectivity/TTableHelper.hxx>
 #include <TConnection.hxx>
diff --git a/connectivity/source/commontools/TKeyColumns.cxx b/connectivity/source/commontools/TKeyColumns.cxx
index 682114e13e34..8c4d36a8cbc9 100644
--- a/connectivity/source/commontools/TKeyColumns.cxx
+++ b/connectivity/source/commontools/TKeyColumns.cxx
@@ -23,8 +23,6 @@
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <TConnection.hxx>
 #include <connectivity/TTableHelper.hxx>
 
diff --git a/connectivity/source/commontools/TTableHelper.cxx b/connectivity/source/commontools/TTableHelper.cxx
index 5086f7e8500a..95ec25398600 100644
--- a/connectivity/source/commontools/TTableHelper.cxx
+++ b/connectivity/source/commontools/TTableHelper.cxx
@@ -29,12 +29,8 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <comphelper/types.hxx>
 #include <connectivity/dbtools.hxx>
 #include <connectivity/sdbcx/VCollection.hxx>
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 77e7c871123c..3dd42e9cadee 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <connectivity/dbconversion.hxx>
-#include <connectivity/dbcharset.hxx>
 #include <osl/diagnose.h>
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/util/Date.hpp>
diff --git a/connectivity/source/commontools/dbexception.cxx b/connectivity/source/commontools/dbexception.cxx
index 9d4d9e7a83d3..f15237d82c88 100644
--- a/connectivity/source/commontools/dbexception.cxx
+++ b/connectivity/source/commontools/dbexception.cxx
@@ -25,7 +25,6 @@
 #include <com/sun/star/sdb/SQLContext.hpp>
 #include <com/sun/star/sdbc/SQLWarning.hpp>
 #include <com/sun/star/sdb/SQLErrorEvent.hpp>
-#include <TConnection.hxx>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
 
diff --git a/connectivity/source/commontools/dbmetadata.cxx b/connectivity/source/commontools/dbmetadata.cxx
index 3d0a6f562223..cec1ec418f5c 100644
--- a/connectivity/source/commontools/dbmetadata.cxx
+++ b/connectivity/source/commontools/dbmetadata.cxx
@@ -36,7 +36,6 @@
 #include <tools/diagnose_ex.h>
 #include <comphelper/namedvaluecollection.hxx>
 #include <comphelper/processfactory.hxx>
-#include <sal/macros.h>
 #include <sal/log.hxx>
 
 #include <o3tl/optional.hxx>
diff --git a/connectivity/source/commontools/dbtools.cxx b/connectivity/source/commontools/dbtools.cxx
index 0bf66b360378..48384ef5e565 100644
--- a/connectivity/source/commontools/dbtools.cxx
+++ b/connectivity/source/commontools/dbtools.cxx
@@ -48,7 +48,6 @@
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/XConnection.hpp>
 #include <com/sun/star/sdbc/XDataSource.hpp>
-#include <com/sun/star/sdbc/XDriverManager.hpp>
 #include <com/sun/star/sdbc/XParameters.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XRowSet.hpp>
@@ -61,7 +60,6 @@
 #include <com/sun/star/task/InteractionHandler.hpp>
 #include <com/sun/star/task/XInteractionRequest.hpp>
 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
-#include <com/sun/star/uno/XNamingService.hpp>
 #include <com/sun/star/util/NumberFormat.hpp>
 #include <com/sun/star/util/NumberFormatsSupplier.hpp>
 #include <com/sun/star/util/XNumberFormatTypes.hpp>
diff --git a/connectivity/source/commontools/dbtools2.cxx b/connectivity/source/commontools/dbtools2.cxx
index 5986595517fc..a5e438f3cb77 100644
--- a/connectivity/source/commontools/dbtools2.cxx
+++ b/connectivity/source/commontools/dbtools2.cxx
@@ -32,11 +32,9 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSetMetaDataSupplier.hpp>
 #include <com/sun/star/sdbcx/XKeysSupplier.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
 #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
 #include <com/sun/star/sdbcx/Privilege.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/sdbc/KeyRule.hpp>
 #include <com/sun/star/sdbcx/KeyType.hpp>
 #include <TConnection.hxx>
diff --git a/connectivity/source/commontools/filtermanager.cxx b/connectivity/source/commontools/filtermanager.cxx
index 08489cf8024a..a6180dd00666 100644
--- a/connectivity/source/commontools/filtermanager.cxx
+++ b/connectivity/source/commontools/filtermanager.cxx
@@ -22,7 +22,6 @@
 #include <com/sun/star/sdb/XSQLQueryComposerFactory.hpp>
 #include <TConnection.hxx>
 #include <osl/diagnose.h>
-#include <connectivity/dbtools.hxx>
 #include <tools/diagnose_ex.h>
 #include <rtl/ustrbuf.hxx>
 
diff --git a/connectivity/source/commontools/formattedcolumnvalue.cxx b/connectivity/source/commontools/formattedcolumnvalue.cxx
index 0bc5c91abd4d..de317c43b4ab 100644
--- a/connectivity/source/commontools/formattedcolumnvalue.cxx
+++ b/connectivity/source/commontools/formattedcolumnvalue.cxx
@@ -35,7 +35,6 @@
 #include <i18nlangtag/mslangid.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <comphelper/numbers.hxx>
-#include <unotools/sharedunocomponent.hxx>
 
 
 namespace dbtools
diff --git a/connectivity/source/commontools/parameters.cxx b/connectivity/source/commontools/parameters.cxx
index 3862ebf0ff08..f7a2d73e109b 100644
--- a/connectivity/source/commontools/parameters.cxx
+++ b/connectivity/source/commontools/parameters.cxx
@@ -24,9 +24,7 @@
 #include <com/sun/star/sdbc/XParameters.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/container/XEnumerationAccess.hpp>
 #include <com/sun/star/sdb/XParametersSupplier.hpp>
-#include <com/sun/star/sdb/XInteractionSupplyParameters.hpp>
 #include <com/sun/star/sdb/ParametersRequest.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/task/XInteractionHandler.hpp>
diff --git a/connectivity/source/commontools/sqlerror.cxx b/connectivity/source/commontools/sqlerror.cxx
index 33e0913e3ea1..f5dd3def56cd 100644
--- a/connectivity/source/commontools/sqlerror.cxx
+++ b/connectivity/source/commontools/sqlerror.cxx
@@ -23,7 +23,6 @@
 
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <com/sun/star/uno/XComponentContext.hpp>
 
 #include <cppuhelper/exc_hlp.hxx>
 #include <rtl/ustrbuf.hxx>
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx
index c347e5ad84c9..d233599a4227 100644
--- a/connectivity/source/cpool/ZConnectionPool.cxx
+++ b/connectivity/source/cpool/ZConnectionPool.cxx
@@ -19,8 +19,6 @@
 
 
 #include "ZConnectionPool.hxx"
-#include <com/sun/star/lang/XSingleServiceFactory.hpp>
-#include <com/sun/star/container/ElementExistException.hpp>
 #include <com/sun/star/lang/XComponent.hpp>
 #include "ZPooledConnection.hxx"
 #include "ZPoolCollection.hxx"
diff --git a/connectivity/source/cpool/ZConnectionWrapper.cxx b/connectivity/source/cpool/ZConnectionWrapper.cxx
index 46ed4bfb32c3..dd4519859f21 100644
--- a/connectivity/source/cpool/ZConnectionWrapper.cxx
+++ b/connectivity/source/cpool/ZConnectionWrapper.cxx
@@ -18,10 +18,6 @@
  */
 
 #include "ZConnectionWrapper.hxx"
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <cppuhelper/typeprovider.hxx>
 
 using namespace connectivity;
 
diff --git a/connectivity/source/cpool/ZPooledConnection.cxx b/connectivity/source/cpool/ZPooledConnection.cxx
index 8bbde8889ec9..2d0b83707905 100644
--- a/connectivity/source/cpool/ZPooledConnection.cxx
+++ b/connectivity/source/cpool/ZPooledConnection.cxx
@@ -19,10 +19,7 @@
 
 #include "ZPooledConnection.hxx"
 #include "ZConnectionWrapper.hxx"
-#include <connectivity/ConnectionWrapper.hxx>
-#include <com/sun/star/sdbc/XCloseable.hpp>
 #include <comphelper/types.hxx>
-#include <cppuhelper/component.hxx>
 
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
diff --git a/connectivity/source/drivers/calc/CConnection.cxx b/connectivity/source/drivers/calc/CConnection.cxx
index f3dc9f2ee733..9b03d473bda1 100644
--- a/connectivity/source/drivers/calc/CConnection.cxx
+++ b/connectivity/source/drivers/calc/CConnection.cxx
@@ -22,7 +22,6 @@
 #include <calc/CCatalog.hxx>
 #include <calc/CDriver.hxx>
 #include <resource/sharedresources.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <tools/urlobj.hxx>
@@ -31,7 +30,6 @@
 #include <unotools/pathoptions.hxx>
 #include <connectivity/dbexception.hxx>
 #include <cppuhelper/exc_hlp.hxx>
-#include <comphelper/processfactory.hxx>
 #include <strings.hrc>
 
 using namespace connectivity::calc;
diff --git a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
index 04b60da887fb..cea1b32c7a94 100644
--- a/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/calc/CDatabaseMetaData.cxx
@@ -19,22 +19,15 @@
 
 #include <calc/CDatabaseMetaData.hxx>
 #include <calc/CConnection.hxx>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XCellRangesQuery.hpp>
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
 #include <com/sun/star/sheet/XDatabaseRanges.hpp>
 #include <com/sun/star/sheet/XDatabaseRange.hpp>
 #include <FDatabaseMetaDataResultSet.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 
 using namespace connectivity::calc;
 using namespace connectivity::file;
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index bcdc12486b09..f22db852d77d 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -21,7 +21,6 @@
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
 #include <com/sun/star/sheet/XSpreadsheet.hpp>
 #include <com/sun/star/sheet/XCellRangeAddressable.hpp>
@@ -35,20 +34,13 @@
 #include <com/sun/star/util/NumberFormat.hpp>
 #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
 #include <com/sun/star/text/XText.hpp>
-#include <svl/converter.hxx>
 #include <calc/CConnection.hxx>
-#include <component/CColumns.hxx>
 #include <connectivity/sdbcx/VColumn.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
-#include <osl/thread.h>
-#include <cppuhelper/queryinterface.hxx>
-#include <svl/zforlist.hxx>
 #include <rtl/math.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbconversion.hxx>
+#include <tools/time.hxx>
 #include <comphelper/servicehelper.hxx>
-#include <comphelper/types.hxx>
 #include <cppuhelper/typeprovider.hxx>
 
 using namespace connectivity;
diff --git a/connectivity/source/drivers/calc/CTables.cxx b/connectivity/source/drivers/calc/CTables.cxx
index 943732fdbb36..703ab27120c5 100644
--- a/connectivity/source/drivers/calc/CTables.cxx
+++ b/connectivity/source/drivers/calc/CTables.cxx
@@ -24,7 +24,6 @@
 #include <calc/CTable.hxx>
 #include <file/FCatalog.hxx>
 #include <file/FConnection.hxx>
-#include <calc/CCatalog.hxx>
 
 using namespace ::comphelper;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/component/CColumns.cxx b/connectivity/source/drivers/component/CColumns.cxx
index 7eb63af23cba..244b6623d460 100644
--- a/connectivity/source/drivers/component/CColumns.cxx
+++ b/connectivity/source/drivers/component/CColumns.cxx
@@ -19,7 +19,6 @@
 
 #include <component/CColumns.hxx>
 #include <file/FTable.hxx>
-#include <connectivity/sdbcx/VColumn.hxx>
 
 using namespace connectivity::component;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/component/CDatabaseMetaData.cxx b/connectivity/source/drivers/component/CDatabaseMetaData.cxx
index 4e43a6c76cff..f225747a6486 100644
--- a/connectivity/source/drivers/component/CDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/component/CDatabaseMetaData.cxx
@@ -18,18 +18,14 @@
  */
 
 #include <component/CDatabaseMetaData.hxx>
-#include <connectivity/sqliterator.hxx>
 #include <file/FConnection.hxx>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
 #include <FDatabaseMetaDataResultSet.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <comphelper/types.hxx>
 
 using namespace connectivity::component;
diff --git a/connectivity/source/drivers/component/CResultSet.cxx b/connectivity/source/drivers/component/CResultSet.cxx
index 6c3e463d2012..9ff212a8911e 100644
--- a/connectivity/source/drivers/component/CResultSet.cxx
+++ b/connectivity/source/drivers/component/CResultSet.cxx
@@ -19,7 +19,6 @@
 
 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
 #include <component/CResultSet.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <comphelper/sequence.hxx>
 #include <comphelper/types.hxx>
diff --git a/connectivity/source/drivers/component/CTable.cxx b/connectivity/source/drivers/component/CTable.cxx
index 2bc92ecfae6d..14b167347d09 100644
--- a/connectivity/source/drivers/component/CTable.cxx
+++ b/connectivity/source/drivers/component/CTable.cxx
@@ -18,32 +18,8 @@
  */
 
 #include <component/CTable.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
-#include <com/sun/star/sheet/XSpreadsheet.hpp>
-#include <com/sun/star/sheet/XCellRangeAddressable.hpp>
-#include <com/sun/star/sheet/XCellRangesQuery.hpp>
-#include <com/sun/star/sheet/XDatabaseRanges.hpp>
-#include <com/sun/star/sheet/XDatabaseRange.hpp>
-#include <com/sun/star/sheet/XCellRangeReferrer.hpp>
-#include <com/sun/star/sheet/XUsedAreaCursor.hpp>
-#include <com/sun/star/sheet/CellFlags.hpp>
-#include <com/sun/star/sheet/FormulaResult.hpp>
-#include <com/sun/star/util/NumberFormat.hpp>
-#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
-#include <com/sun/star/text/XText.hpp>
-#include <svl/converter.hxx>
 #include <component/CColumns.hxx>
-#include <connectivity/sdbcx/VColumn.hxx>
-#include <rtl/ustrbuf.hxx>
-#include <osl/thread.h>
 #include <cppuhelper/queryinterface.hxx>
-#include <svl/zforlist.hxx>
-#include <rtl/math.hxx>
-#include <connectivity/dbexception.hxx>
-#include <connectivity/dbconversion.hxx>
 
 using namespace connectivity;
 using namespace connectivity::component;
@@ -57,8 +33,6 @@ using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::sheet;
-using namespace ::com::sun::star::table;
-using namespace ::com::sun::star::text;
 using namespace ::com::sun::star::util;
 
 
diff --git a/connectivity/source/drivers/dbase/DColumns.cxx b/connectivity/source/drivers/dbase/DColumns.cxx
index b06bdd99173c..6f884dca8572 100644
--- a/connectivity/source/drivers/dbase/DColumns.cxx
+++ b/connectivity/source/drivers/dbase/DColumns.cxx
@@ -20,7 +20,6 @@
 #include <dbase/DColumns.hxx>
 #include <dbase/DTable.hxx>
 #include <connectivity/sdbcx/VColumn.hxx>
-#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 
 using namespace connectivity::dbase;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/dbase/DConnection.cxx b/connectivity/source/drivers/dbase/DConnection.cxx
index c9881aed6f92..7c577b7c9541 100644
--- a/connectivity/source/drivers/dbase/DConnection.cxx
+++ b/connectivity/source/drivers/dbase/DConnection.cxx
@@ -22,7 +22,6 @@
 #include <dbase/DDatabaseMetaData.hxx>
 #include <dbase/DCatalog.hxx>
 #include <dbase/DDriver.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <dbase/DPreparedStatement.hxx>
 #include <dbase/DStatement.hxx>
 #include <connectivity/dbexception.hxx>
diff --git a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
index 5aad3708e908..b896e942cb01 100644
--- a/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/dbase/DDatabaseMetaData.cxx
@@ -21,14 +21,11 @@
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
 #include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
 #include <FDatabaseMetaDataResultSet.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <dbase/DIndex.hxx>
 #include <connectivity/FValue.hxx>
 #include <comphelper/processfactory.hxx>
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index 5e4afbc94eb8..0dae008f981f 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -19,17 +19,13 @@
 
 #include <dbase/DIndex.hxx>
 #include <dbase/DIndexColumns.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <connectivity/sdbcx/VColumn.hxx>
 #include <dbase/DTable.hxx>
 #include <dbase/DIndexIter.hxx>
 #include <osl/file.hxx>
 #include <sal/log.hxx>
 #include <tools/config.hxx>
 #include <connectivity/CommonTools.hxx>
-#include <com/sun/star/sdbc/XResultSetMetaData.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/XRowLocate.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <unotools/ucbhelper.hxx>
 #include <comphelper/servicehelper.hxx>
diff --git a/connectivity/source/drivers/dbase/DIndexColumns.cxx b/connectivity/source/drivers/dbase/DIndexColumns.cxx
index 533a6023ef2a..2ad8c3aa8987 100644
--- a/connectivity/source/drivers/dbase/DIndexColumns.cxx
+++ b/connectivity/source/drivers/dbase/DIndexColumns.cxx
@@ -21,7 +21,6 @@
 #include <dbase/DTable.hxx>
 #include <connectivity/sdbcx/VIndexColumn.hxx>
 #include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
 
 using namespace ::comphelper;
 
diff --git a/connectivity/source/drivers/dbase/DResultSet.cxx b/connectivity/source/drivers/dbase/DResultSet.cxx
index 22826ec2fd0f..2ca942fecdc8 100644
--- a/connectivity/source/drivers/dbase/DResultSet.cxx
+++ b/connectivity/source/drivers/dbase/DResultSet.cxx
@@ -19,7 +19,6 @@
 
 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
 #include <dbase/DResultSet.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index 56f9f8d5eee1..06d0fdf7d576 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -26,18 +26,14 @@
 #include <svl/converter.hxx>
 #include <dbase/DConnection.hxx>
 #include <dbase/DColumns.hxx>
-#include <osl/thread.h>
 #include <tools/config.hxx>
 #include <dbase/DIndex.hxx>
 #include <dbase/DIndexes.hxx>
 #include <comphelper/processfactory.hxx>
-#include <svl/zforlist.hxx>
-#include <unotools/syslocale.hxx>
 #include <rtl/math.hxx>
 #include <ucbhelper/content.hxx>
 #include <com/sun/star/ucb/ContentCreationException.hpp>
 #include <connectivity/dbexception.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
 #include <comphelper/property.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -48,13 +44,14 @@
 #include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/exc_hlp.hxx>
 #include <cppuhelper/queryinterface.hxx>
-#include <connectivity/PColumn.hxx>
 #include <connectivity/dbtools.hxx>
 #include <connectivity/FValue.hxx>
 #include <connectivity/dbconversion.hxx>
+#include <connectivity/sdbcx/VColumn.hxx>
 #include <strings.hrc>
 #include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
+#include <tools/date.hxx>
 
 #include <algorithm>
 #include <cassert>
diff --git a/connectivity/source/drivers/dbase/DTables.cxx b/connectivity/source/drivers/dbase/DTables.cxx
index 8f218811037b..1d922969493f 100644
--- a/connectivity/source/drivers/dbase/DTables.cxx
+++ b/connectivity/source/drivers/dbase/DTables.cxx
@@ -23,11 +23,6 @@
 #include <dbase/DTables.hxx>
 #include <dbase/DTable.hxx>
 #include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
 #include <file/FCatalog.hxx>
 #include <file/FConnection.hxx>
 #include <com/sun/star/lang/XUnoTunnel.hpp>
diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx
index 251563e4d1d5..43db753bdaf9 100644
--- a/connectivity/source/drivers/dbase/dindexnode.cxx
+++ b/connectivity/source/drivers/dbase/dindexnode.cxx
@@ -18,8 +18,6 @@
  */
 
 #include <dbase/dindexnode.hxx>
-#include <connectivity/CommonTools.hxx>
-#include <osl/thread.h>
 #include <dbase/DIndex.hxx>
 #include <tools/debug.hxx>
 #include <tools/stream.hxx>
diff --git a/connectivity/source/drivers/evoab2/NColumns.cxx b/connectivity/source/drivers/evoab2/NColumns.cxx
index c74751628f84..378e2af77634 100644
--- a/connectivity/source/drivers/evoab2/NColumns.cxx
+++ b/connectivity/source/drivers/evoab2/NColumns.cxx
@@ -20,8 +20,6 @@
 
 #include "NColumns.hxx"
 #include "NTable.hxx"
-#include "NTables.hxx"
-#include "NCatalog.hxx"
 #include <connectivity/sdbcx/VColumn.hxx>
 #include <com/sun/star/sdbc/XRow.hpp>
 
diff --git a/connectivity/source/drivers/evoab2/NConnection.cxx b/connectivity/source/drivers/evoab2/NConnection.cxx
index 5355a55b786d..d586d6ba2df1 100644
--- a/connectivity/source/drivers/evoab2/NConnection.cxx
+++ b/connectivity/source/drivers/evoab2/NConnection.cxx
@@ -20,7 +20,6 @@
 #include "NConnection.hxx"
 #include "NDatabaseMetaData.hxx"
 #include "NCatalog.hxx"
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
 #include "NPreparedStatement.hxx"
 #include "NStatement.hxx"
diff --git a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
index 4ec577c5874c..85673db40afe 100644
--- a/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NDatabaseMetaData.cxx
@@ -19,16 +19,12 @@
 
 #include "NDatabaseMetaData.hxx"
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
 #include <connectivity/dbexception.hxx>
 #include <connectivity/FValue.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 
 #include <cstddef>
-#include <vector>
 #include <string.h>
 #include "EApi.h"
 
diff --git a/connectivity/source/drivers/evoab2/NDriver.cxx b/connectivity/source/drivers/evoab2/NDriver.cxx
index fdbebf0000f4..d7f4e376a9ab 100644
--- a/connectivity/source/drivers/evoab2/NDriver.cxx
+++ b/connectivity/source/drivers/evoab2/NDriver.cxx
@@ -21,13 +21,8 @@
 #include "NConnection.hxx"
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <connectivity/dbexception.hxx>
-#include <osl/file.hxx>
-#include <osl/security.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/ucb/XCommandEnvironment.hpp>
-#include <ucbhelper/content.hxx>
-#include <signal.h>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
 
diff --git a/connectivity/source/drivers/evoab2/NPreparedStatement.cxx b/connectivity/source/drivers/evoab2/NPreparedStatement.cxx
index 1f4f04a63150..57981e95e82d 100644
--- a/connectivity/source/drivers/evoab2/NPreparedStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NPreparedStatement.cxx
@@ -19,10 +19,6 @@
 
 
 #include "NPreparedStatement.hxx"
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <propertyids.hxx>
 #include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
 #include <tools/diagnose_ex.h>
diff --git a/connectivity/source/drivers/evoab2/NResultSet.cxx b/connectivity/source/drivers/evoab2/NResultSet.cxx
index 1341e5a33c68..3768c09dd3ad 100644
--- a/connectivity/source/drivers/evoab2/NResultSet.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSet.cxx
@@ -23,23 +23,17 @@
 #include "NResultSet.hxx"
 #include <propertyids.hxx>
 #include <strings.hrc>
-#include <TSortIndex.hxx>
-#include <algorithm>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/sdb/ErrorCondition.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 
 #include <comphelper/sequence.hxx>
-#include <comphelper/types.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <connectivity/dbexception.hxx>
 #include <connectivity/sqlerror.hxx>
-#include <cppuhelper/typeprovider.hxx>
 #include <rtl/string.hxx>
 #include <sal/log.hxx>
 #include <tools/diagnose_ex.h>
@@ -48,7 +42,6 @@
 #include <unotools/collatorwrapper.hxx>
 
 #include <cstring>
-#include <vector>
 
 namespace connectivity { namespace evoab {
 
diff --git a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx
index 7d9f0d152d76..9bbff49ccc7b 100644
--- a/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx
+++ b/connectivity/source/drivers/evoab2/NResultSetMetaData.cxx
@@ -20,7 +20,6 @@
 #include "NResultSetMetaData.hxx"
 #include "NDatabaseMetaData.hxx"
 #include <connectivity/dbexception.hxx>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <strings.hrc>
 
 using namespace connectivity::evoab;
diff --git a/connectivity/source/drivers/evoab2/NStatement.cxx b/connectivity/source/drivers/evoab2/NStatement.cxx
index dc39832c1bd9..94f50e7177c1 100644
--- a/connectivity/source/drivers/evoab2/NStatement.cxx
+++ b/connectivity/source/drivers/evoab2/NStatement.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <osl/diagnose.h>
-#include <osl/thread.h>
 #include <rtl/ustring.hxx>
 #include <sal/log.hxx>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
diff --git a/connectivity/source/drivers/evoab2/NTable.cxx b/connectivity/source/drivers/evoab2/NTable.cxx
index 1e18b8a1f6cd..b5c652a8ff67 100644
--- a/connectivity/source/drivers/evoab2/NTable.cxx
+++ b/connectivity/source/drivers/evoab2/NTable.cxx
@@ -19,9 +19,7 @@
 
 
 #include "NTable.hxx"
-#include "NTables.hxx"
 #include "NColumns.hxx"
-#include "NCatalog.hxx"
 
 #include <com/sun/star/sdbc/XRow.hpp>
 
diff --git a/connectivity/source/drivers/evoab2/NTables.cxx b/connectivity/source/drivers/evoab2/NTables.cxx
index 757445866f40..b7a844fac15d 100644
--- a/connectivity/source/drivers/evoab2/NTables.cxx
+++ b/connectivity/source/drivers/evoab2/NTables.cxx
@@ -20,15 +20,7 @@
 #include "NTables.hxx"
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <connectivity/sdbcx/VTable.hxx>
 #include "NCatalog.hxx"
-#include "NConnection.hxx"
-#include <connectivity/dbtools.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/interfacecontainer.h>
 #include <comphelper/types.hxx>
 #include "NTable.hxx"
 using namespace ::comphelper;
diff --git a/connectivity/source/drivers/file/FColumns.cxx b/connectivity/source/drivers/file/FColumns.cxx
index 4fe835fc921b..e703112f71c4 100644
--- a/connectivity/source/drivers/file/FColumns.cxx
+++ b/connectivity/source/drivers/file/FColumns.cxx
@@ -21,8 +21,6 @@
 #include <connectivity/sdbcx/VColumn.hxx>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <file/FTable.hxx>
 
 using namespace connectivity::file;
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 3eeea6735f1e..5c56ce4d5e5d 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -27,9 +27,6 @@
 #include <file/FDriver.hxx>
 #include <file/FStatement.hxx>
 #include <file/FPreparedStatement.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/ucb/ContentCreationException.hpp>
 #include <com/sun/star/ucb/XContent.hpp>
@@ -42,7 +39,6 @@
 #include <connectivity/dbexception.hxx>
 #include <o3tl/any.hxx>
 #include <osl/thread.h>
-#include <osl/nlsupport.h>
 #include <strings.hrc>
 
 using namespace connectivity::file;
diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index 44404f98267a..3d01216a39fd 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -19,14 +19,9 @@
 
 #include <file/FDatabaseMetaData.hxx>
 #include <FDatabaseMetaDataResultSet.hxx>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/ucb/SearchRecursion.hpp>
-#include <com/sun/star/ucb/SearchCommandArgument.hpp>
 #include <com/sun/star/ucb/UniversalContentBroker.hpp>
 #include <com/sun/star/ucb/SortedDynamicResultSetFactory.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <tools/urlobj.hxx>
 #include <sal/log.hxx>
 #include <file/FDriver.hxx>
diff --git a/connectivity/source/drivers/file/FDriver.cxx b/connectivity/source/drivers/file/FDriver.cxx
index 367fd1f3416c..c2956adc279b 100644
--- a/connectivity/source/drivers/file/FDriver.cxx
+++ b/connectivity/source/drivers/file/FDriver.cxx
@@ -20,7 +20,6 @@
 #include <file/FDriver.hxx>
 #include <file/FConnection.hxx>
 #include <file/fcode.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <comphelper/types.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <connectivity/dbexception.hxx>
diff --git a/connectivity/source/drivers/file/FPreparedStatement.cxx b/connectivity/source/drivers/file/FPreparedStatement.cxx
index b82a702a7c95..9cf70d452c10 100644
--- a/connectivity/source/drivers/file/FPreparedStatement.cxx
+++ b/connectivity/source/drivers/file/FPreparedStatement.cxx
@@ -18,7 +18,6 @@
  */
 
 
-#include <connectivity/sdbcx/VColumn.hxx>
 #include <osl/diagnose.h>
 #include <file/FPreparedStatement.hxx>
 #include <com/sun/star/sdbc/DataType.hpp>
@@ -26,7 +25,6 @@
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/sequence.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <connectivity/dbconversion.hxx>
 #include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index 29c2d1caeb95..adcbb0897197 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -18,23 +18,15 @@
  */
 
 
-#ifdef __GNUC__
-#include <iostream>
-#endif
-#include <connectivity/sdbcx/VColumn.hxx>
 #include <file/FResultSet.hxx>
 #include <sqlbison.hxx>
 #include <file/FResultSetMetaData.hxx>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <com/sun/star/container/XIndexAccess.hpp>
 #include <comphelper/sequence.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/typeprovider.hxx>
-#include <connectivity/dbconversion.hxx>
 #include <connectivity/dbtools.hxx>
 #include <cppuhelper/propshlp.hxx>
 #include <sal/log.hxx>
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index 3d45af9f3648..24e176d140c2 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -23,13 +23,11 @@
 #include <sqlbison.hxx>
 #include <file/FDriver.hxx>
 #include <file/FResultSet.hxx>
-#include <osl/thread.h>
 #include <sal/log.hxx>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
-#include <comphelper/processfactory.hxx>
 #include <comphelper/sequence.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/types.hxx>
diff --git a/connectivity/source/drivers/file/FTable.cxx b/connectivity/source/drivers/file/FTable.cxx
index 11c46f73f455..b47bfb811a1f 100644
--- a/connectivity/source/drivers/file/FTable.cxx
+++ b/connectivity/source/drivers/file/FTable.cxx
@@ -24,8 +24,6 @@
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/typeprovider.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <unotools/ucbstreamhelper.hxx>
 
 using namespace connectivity;
diff --git a/connectivity/source/drivers/file/FTables.cxx b/connectivity/source/drivers/file/FTables.cxx
index 9ccf5f35903e..c063f4a890e6 100644
--- a/connectivity/source/drivers/file/FTables.cxx
+++ b/connectivity/source/drivers/file/FTables.cxx
@@ -18,14 +18,7 @@
  */
 
 #include <file/FTables.hxx>
-#include <file/FTable.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
 #include <file/FCatalog.hxx>
-#include <file/FConnection.hxx>
 
 using namespace connectivity;
 using namespace connectivity::file;
diff --git a/connectivity/source/drivers/file/fanalyzer.cxx b/connectivity/source/drivers/file/fanalyzer.cxx
index 93b728827d9a..9764b14f853d 100644
--- a/connectivity/source/drivers/file/fanalyzer.cxx
+++ b/connectivity/source/drivers/file/fanalyzer.cxx
@@ -21,7 +21,6 @@
 #include <connectivity/sqlparse.hxx>
 #include <tools/debug.hxx>
 #include <connectivity/sqlnode.hxx>
-#include <connectivity/dbexception.hxx>
 #include <file/FConnection.hxx>
 #include <strings.hrc>
 
diff --git a/connectivity/source/drivers/file/fcode.cxx b/connectivity/source/drivers/file/fcode.cxx
index c4bebbfd7cca..2950b113d839 100644
--- a/connectivity/source/drivers/file/fcode.cxx
+++ b/connectivity/source/drivers/file/fcode.cxx
@@ -22,10 +22,7 @@
 #include <sal/log.hxx>
 #include <connectivity/sqlparse.hxx>
 #include <sqlbison.hxx>
-#include <i18nlangtag/mslangid.hxx>
-#include <TConnection.hxx>
 #include <com/sun/star/sdb/SQLFilterOperator.hpp>
-#include <comphelper/types.hxx>
 
 using namespace ::comphelper;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/file/fcomp.cxx b/connectivity/source/drivers/file/fcomp.cxx
index 7de9c5fb60dc..134565e3e3de 100644
--- a/connectivity/source/drivers/file/fcomp.cxx
+++ b/connectivity/source/drivers/file/fcomp.cxx
@@ -19,7 +19,6 @@
 
 #include <file/fcomp.hxx>
 #include <tools/debug.hxx>
-#include <TConnection.hxx>
 #include <connectivity/sqlparse.hxx>
 #include <file/fanalyzer.hxx>
 #include <com/sun/star/sdbc/XColumnLocate.hpp>
diff --git a/connectivity/source/drivers/firebird/Blob.cxx b/connectivity/source/drivers/firebird/Blob.cxx
index 02f94ef0c0b1..3468a50ce3f4 100644
--- a/connectivity/source/drivers/firebird/Blob.cxx
+++ b/connectivity/source/drivers/firebird/Blob.cxx
@@ -8,7 +8,6 @@
  */
 
 #include "Blob.hxx"
-#include "Connection.hxx"
 #include "Util.hxx"
 
 #include <com/sun/star/io/BufferSizeExceededException.hpp>
@@ -17,9 +16,9 @@
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
+#include <connectivity/CommonTools.hxx>
 #include <connectivity/dbexception.hxx>
 #include <cppuhelper/exc_hlp.hxx>
-#include <sal/log.hxx>
 #include <tools/diagnose_ex.h>
 
 using namespace ::connectivity::firebird;
diff --git a/connectivity/source/drivers/firebird/Clob.cxx b/connectivity/source/drivers/firebird/Clob.cxx
index 5f73f8150727..2038dfc11350 100644
--- a/connectivity/source/drivers/firebird/Clob.cxx
+++ b/connectivity/source/drivers/firebird/Clob.cxx
@@ -13,11 +13,9 @@
 
 #include "Clob.hxx"
 #include "Blob.hxx"
-#include "Connection.hxx"
-#include "Util.hxx"
 
+#include <connectivity/CommonTools.hxx>
 #include <connectivity/dbexception.hxx>
-#include <cppuhelper/exc_hlp.hxx>
 
 using namespace ::connectivity::firebird;
 
diff --git a/connectivity/source/drivers/firebird/Column.cxx b/connectivity/source/drivers/firebird/Column.cxx
index 9c13499f8772..31767bf9c4b5 100644
--- a/connectivity/source/drivers/firebird/Column.cxx
+++ b/connectivity/source/drivers/firebird/Column.cxx
@@ -7,7 +7,6 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include "Columns.hxx"
 #include "Column.hxx"
 
 #include <TConnection.hxx>
diff --git a/connectivity/source/drivers/firebird/Columns.cxx b/connectivity/source/drivers/firebird/Columns.cxx
index 38c40820ca60..293dac97dc5b 100644
--- a/connectivity/source/drivers/firebird/Columns.cxx
+++ b/connectivity/source/drivers/firebird/Columns.cxx
@@ -10,8 +10,6 @@
 #include "Columns.hxx"
 #include "Column.hxx"
 
-#include <com/sun/star/sdbc/XRow.hpp>
-
 using namespace ::connectivity;
 using namespace ::connectivity::firebird;
 using namespace ::connectivity::sdbcx;
diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx
index df278084c178..58aad4e1939e 100644
--- a/connectivity/source/drivers/firebird/Connection.cxx
+++ b/connectivity/source/drivers/firebird/Connection.cxx
@@ -25,26 +25,21 @@
 #include "Driver.hxx"
 #include "PreparedStatement.hxx"
 #include "Statement.hxx"
-#include "Tables.hxx"
 #include "Util.hxx"
 
 #include <stdexcept>
 
 #include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
 #include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/io/TempFile.hpp>
 #include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/lang/EventObject.hpp>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
+#include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
 #include <com/sun/star/ucb/SimpleFileAccess.hpp>
 #include <com/sun/star/ucb/XSimpleFileAccess2.hpp>
 
 #include <connectivity/dbexception.hxx>
-#include <connectivity/sqlparse.hxx>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
 
diff --git a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
index e77322e86f6e..3fa2c613cb04 100644
--- a/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/firebird/DatabaseMetaData.cxx
@@ -33,7 +33,6 @@
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <com/sun/star/sdbc/XParameters.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/KeyRule.hpp>
 #include <com/sun/star/sdbc/Deferrability.hpp>
diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx
index 4586cc4a3ba4..002723d9a697 100644
--- a/connectivity/source/drivers/firebird/PreparedStatement.cxx
+++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx
@@ -30,14 +30,11 @@
 
 #include <comphelper/sequence.hxx>
 #include <connectivity/dbexception.hxx>
-#include <cppuhelper/typeprovider.hxx>
 #include <propertyids.hxx>
-#include <time.h>
 #include <connectivity/dbtools.hxx>
 #include <sal/log.hxx>
 
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 
 using namespace connectivity::firebird;
 
diff --git a/connectivity/source/drivers/firebird/ResultSet.cxx b/connectivity/source/drivers/firebird/ResultSet.cxx
index 257ff0675c80..9409701d431f 100644
--- a/connectivity/source/drivers/firebird/ResultSet.cxx
+++ b/connectivity/source/drivers/firebird/ResultSet.cxx
@@ -22,24 +22,19 @@
 #include "Util.hxx"
 
 #include <comphelper/sequence.hxx>
-#include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <connectivity/dbexception.hxx>
 #include <propertyids.hxx>
-#include <rtl/string.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
-#include <time.h>
 #include <TConnection.hxx>
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/sdbcx/CompareBookmark.hpp>
 
 using namespace ::comphelper;
 using namespace ::connectivity;
diff --git a/connectivity/source/drivers/firebird/Statement.cxx b/connectivity/source/drivers/firebird/Statement.cxx
index 285f68257074..418c66a7d0cd 100644
--- a/connectivity/source/drivers/firebird/Statement.cxx
+++ b/connectivity/source/drivers/firebird/Statement.cxx
@@ -18,22 +18,14 @@
  */
 
 #include "Connection.hxx"
-#include "Driver.hxx"
 #include "ResultSet.hxx"
 #include "Statement.hxx"
 #include "Util.hxx"
 
 #include <comphelper/sequence.hxx>
 #include <cppuhelper/queryinterface.hxx>
-#include <osl/thread.h>
-#include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-
 using namespace connectivity::firebird;
 
 using namespace com::sun::star;
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
index 097234e9f1e2..c1219d74b8ed 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
@@ -18,7 +18,6 @@
  */
 
 #include "Driver.hxx"
-#include "ResultSet.hxx"
 #include "StatementCommonBase.hxx"
 #include "Util.hxx"
 
diff --git a/connectivity/source/drivers/firebird/Users.cxx b/connectivity/source/drivers/firebird/Users.cxx
index 0423d9c33181..4225b490aa8c 100644
--- a/connectivity/source/drivers/firebird/Users.cxx
+++ b/connectivity/source/drivers/firebird/Users.cxx
@@ -10,10 +10,6 @@
 #include "User.hxx"
 #include "Users.hxx"
 
-#include <connectivity/dbtools.hxx>
-
-#include <com/sun/star/sdbc/XRow.hpp>
-
 using namespace ::connectivity;
 using namespace ::connectivity::firebird;
 using namespace ::connectivity::sdbcx;
diff --git a/connectivity/source/drivers/firebird/Util.cxx b/connectivity/source/drivers/firebird/Util.cxx
index c89540c1d90b..020dffbf2076 100644
--- a/connectivity/source/drivers/firebird/Util.cxx
+++ b/connectivity/source/drivers/firebird/Util.cxx
@@ -9,7 +9,6 @@
 
 #include "Util.hxx"
 #include <rtl/ustrbuf.hxx>
-#include <rtl/strbuf.hxx>
 #include <sal/log.hxx>
 
 #include <com/sun/star/sdbc/DataType.hpp>
diff --git a/connectivity/source/drivers/flat/EColumns.cxx b/connectivity/source/drivers/flat/EColumns.cxx
index 6336753d30d9..3aae644f2e99 100644
--- a/connectivity/source/drivers/flat/EColumns.cxx
+++ b/connectivity/source/drivers/flat/EColumns.cxx
@@ -19,7 +19,6 @@
 
 #include <flat/EColumns.hxx>
 #include <flat/ETable.hxx>
-#include <connectivity/sdbcx/VColumn.hxx>
 
 using namespace connectivity::flat;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/flat/EConnection.cxx b/connectivity/source/drivers/flat/EConnection.cxx
index 8091c435ac4c..5127d903cc6d 100644
--- a/connectivity/source/drivers/flat/EConnection.cxx
+++ b/connectivity/source/drivers/flat/EConnection.cxx
@@ -21,7 +21,6 @@
 #include <flat/EDatabaseMetaData.hxx>
 #include <flat/ECatalog.hxx>
 #include <flat/EDriver.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <flat/EPreparedStatement.hxx>
 #include <flat/EStatement.hxx>
 #include <connectivity/dbexception.hxx>
diff --git a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
index 76a19797bfa7..b69b34e363c3 100644
--- a/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/flat/EDatabaseMetaData.cxx
@@ -20,15 +20,10 @@
 #include <flat/EDatabaseMetaData.hxx>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
-#include <com/sun/star/beans/XFastPropertySet.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
-#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
 #include <FDatabaseMetaDataResultSet.hxx>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <comphelper/types.hxx>
 
 using namespace ::comphelper;
diff --git a/connectivity/source/drivers/flat/EResultSet.cxx b/connectivity/source/drivers/flat/EResultSet.cxx
index 6247e2759b51..150c7971b1c9 100644
--- a/connectivity/source/drivers/flat/EResultSet.cxx
+++ b/connectivity/source/drivers/flat/EResultSet.cxx
@@ -20,7 +20,6 @@
 #include <com/sun/star/sdbcx/CompareBookmark.hpp>
 #include <com/sun/star/sdbcx/XDeleteRows.hpp>
 #include <flat/EResultSet.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
 #include <comphelper/sequence.hxx>
 #include <comphelper/types.hxx>
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 450383cbb0a1..2da5d6ab8570 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -22,11 +22,8 @@
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/ucb/XContentAccess.hpp>
-#include <svl/converter.hxx>
 #include <flat/EConnection.hxx>
 #include <flat/EColumns.hxx>
-#include <osl/thread.h>
-#include <svl/zforlist.hxx>
 #include <rtl/math.hxx>
 #include <sal/log.hxx>
 #include <tools/solar.h>
@@ -34,18 +31,15 @@
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/numbers.hxx>
-#include <comphelper/processfactory.hxx>
 #include <comphelper/servicehelper.hxx>
-#include <comphelper/types.hxx>
-#include <flat/EDriver.hxx>
 #include <com/sun/star/util/NumberFormat.hpp>
 #include <com/sun/star/util/NumberFormatter.hpp>
 #include <com/sun/star/util/NumberFormatsSupplier.hpp>
-#include <unotools/configmgr.hxx>
 #include <i18nlangtag/languagetag.hxx>
 #include <connectivity/dbconversion.hxx>
 #include <connectivity/sdbcx/VColumn.hxx>
 #include <file/quotedstring.hxx>
+#include <file/FDriver.hxx>
 #include <unotools/syslocale.hxx>
 #include <unotools/charclass.hxx>
 
@@ -54,7 +48,6 @@ using namespace connectivity;
 using namespace connectivity::flat;
 using namespace connectivity::file;
 using namespace ::cppu;
-using namespace utl;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::beans;
diff --git a/connectivity/source/drivers/flat/ETables.cxx b/connectivity/source/drivers/flat/ETables.cxx
index f38b73e81167..81f366a9e7d0 100644
--- a/connectivity/source/drivers/flat/ETables.cxx
+++ b/connectivity/source/drivers/flat/ETables.cxx
@@ -19,13 +19,7 @@
 
 #include <flat/ETables.hxx>
 #include <flat/ETable.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
 #include <file/FCatalog.hxx>
-#include <file/FConnection.hxx>
 
 using namespace connectivity;
 using namespace ::comphelper;
diff --git a/connectivity/source/drivers/hsqldb/HConnection.cxx b/connectivity/source/drivers/hsqldb/HConnection.cxx
index af6f49afee17..497b2cec2fa1 100644
--- a/connectivity/source/drivers/hsqldb/HConnection.cxx
+++ b/connectivity/source/drivers/hsqldb/HConnection.cxx
@@ -29,7 +29,6 @@
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/graphic/GraphicProvider.hpp>
 #include <com/sun/star/graphic/XGraphicProvider.hpp>
-#include <com/sun/star/graphic/GraphicColorMode.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/sdbc/XDatabaseMetaData2.hpp>
 
diff --git a/connectivity/source/drivers/hsqldb/HDriver.cxx b/connectivity/source/drivers/hsqldb/HDriver.cxx
index de64ef4a14ef..7e006ecb61a2 100644
--- a/connectivity/source/drivers/hsqldb/HDriver.cxx
+++ b/connectivity/source/drivers/hsqldb/HDriver.cxx
@@ -17,8 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <config_folders.h>
-
 #include <hsqldb/HDriver.hxx>
 #include <hsqldb/HConnection.hxx>
 #include <osl/diagnose.h>
@@ -26,7 +24,6 @@
 #include <connectivity/dbexception.hxx>
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
 #include <com/sun/star/sdbc/DriverManager.hpp>
-#include <com/sun/star/sdbc/XDriverAccess.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/embed/XTransactionBroadcaster.hpp>
@@ -37,7 +34,6 @@
 #include <com/sun/star/reflection/XProxyFactory.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
-#include <com/sun/star/lang/Locale.hpp>
 #include <com/sun/star/util/XFlushable.hpp>
 #include "HTerminateListener.hxx"
 #include <hsqldb/HCatalog.hxx>
diff --git a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
index bdb3ec58df0a..f5d4110a36f0 100644
--- a/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageAccess.cxx
@@ -19,8 +19,6 @@
 
 #include <hsqldb/HStorageAccess.hxx>
 #include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
-#include <com/sun/star/io/XStream.hpp>
 #include <hsqldb/HStorageMap.hxx>
 #include "accesslog.hxx"
 #include <osl/diagnose.h>
diff --git a/connectivity/source/drivers/hsqldb/HStorageMap.cxx b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
index 04116d02f036..3d6afc05b310 100644
--- a/connectivity/source/drivers/hsqldb/HStorageMap.cxx
+++ b/connectivity/source/drivers/hsqldb/HStorageMap.cxx
@@ -24,7 +24,6 @@
 #include <com/sun/star/embed/ElementModes.hpp>
 #include <com/sun/star/lang/DisposedException.hpp>
 #include <osl/diagnose.h>
-#include <osl/thread.h>
 #include <sal/log.hxx>
 #include <uno/mapping.hxx>
 #include <algorithm>
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index ab7d95812f40..f8dee57c510c 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -17,27 +17,16 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
 #include <hsqldb/HTable.hxx>
-#include <hsqldb/HTables.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
 #include <cppuhelper/typeprovider.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbcx/Privilege.hpp>
 #include <comphelper/property.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <comphelper/types.hxx>
 #include <connectivity/dbtools.hxx>
-#include <connectivity/sdbcx/VColumn.hxx>
 #include <connectivity/TKeys.hxx>
 #include <connectivity/TIndexes.hxx>
-#include <connectivity/TColumnsHelper.hxx>
-#include <hsqldb/HCatalog.hxx>
 #include <hsqldb/HColumns.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/hsqldb/HTables.cxx b/connectivity/source/drivers/hsqldb/HTables.cxx
index c2b13cfe79ca..b98d57c774ab 100644
--- a/connectivity/source/drivers/hsqldb/HTables.cxx
+++ b/connectivity/source/drivers/hsqldb/HTables.cxx
@@ -22,14 +22,9 @@
 #include <hsqldb/HTable.hxx>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
 #include <hsqldb/HCatalog.hxx>
 #include <connectivity/dbtools.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/interfacecontainer.h>
 #include <comphelper/types.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/hsqldb/HUsers.cxx b/connectivity/source/drivers/hsqldb/HUsers.cxx
index c6992c9328c3..40d1f5243cb6 100644
--- a/connectivity/source/drivers/hsqldb/HUsers.cxx
+++ b/connectivity/source/drivers/hsqldb/HUsers.cxx
@@ -19,12 +19,8 @@
 
 #include <hsqldb/HUsers.hxx>
 #include <hsqldb/HUser.hxx>
-#include <hsqldb/HTable.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
 #include <connectivity/sdbcx/IRefreshable.hxx>
 #include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/hsqldb/HView.cxx b/connectivity/source/drivers/hsqldb/HView.cxx
index 0eb3fd9439e4..f0e53e8534fd 100644
--- a/connectivity/source/drivers/hsqldb/HView.cxx
+++ b/connectivity/source/drivers/hsqldb/HView.cxx
@@ -23,7 +23,6 @@
 
 #include <propertyids.hxx>
 
-#include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
 
 #include <com/sun/star/lang/WrappedTargetException.hpp>
diff --git a/connectivity/source/drivers/hsqldb/HViews.cxx b/connectivity/source/drivers/hsqldb/HViews.cxx
index 8914d4e5b945..e67a9fa14f86 100644
--- a/connectivity/source/drivers/hsqldb/HViews.cxx
+++ b/connectivity/source/drivers/hsqldb/HViews.cxx
@@ -21,16 +21,8 @@
 #include <hsqldb/HTables.hxx>
 #include <hsqldb/HViews.hxx>
 #include <hsqldb/HView.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/CheckOption.hpp>
 #include <hsqldb/HCatalog.hxx>
 #include <connectivity/dbtools.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/interfacecontainer.h>
 #include <comphelper/types.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
index 756b2d008da9..b8b698f50254 100644
--- a/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageFileAccess.cxx
@@ -21,12 +21,10 @@
 #if defined(HAVE_CONFIG_H) && HAVE_CONFIG_H
 #include <config.h>
 #endif
-#include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/embed/XStorage.hpp>
 #include <com/sun/star/lang/IllegalArgumentException.hpp>
 #include <hsqldb/HStorageMap.hxx>
 #include <osl/diagnose.h>
-#include <sal/log.hxx>
 #include <tools/diagnose_ex.h>
 
 using namespace ::com::sun::star::container;
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
index e6a84d46bed5..28221925dcc2 100644
--- a/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageNativeInputStream.cxx
@@ -22,15 +22,10 @@
 #include <config.h>
 #endif
 #include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
 #include <hsqldb/HStorageAccess.hxx>
 #include <hsqldb/HStorageMap.hxx>
 
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
 #include <osl/diagnose.h>
 #include "accesslog.hxx"
 
diff --git a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx
index bd6229d0566e..7a4f2b7aa50c 100644
--- a/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx
+++ b/connectivity/source/drivers/hsqldb/StorageNativeOutputStream.cxx
@@ -21,23 +21,15 @@
 #include <config.h>
 #endif
 
-#include <uno/mapping.hxx>
-#include <uno/environment.hxx>
 #include <cppuhelper/bootstrap.hxx>
-#include <cppuhelper/component_context.hxx>
+#include <osl/diagnose.h>
 #include "accesslog.hxx"
 #include <com/sun/star/embed/XTransactedObject.hpp>
 #include <com/sun/star/io/XStream.hpp>
-#include <com/sun/star/container/XNameAccess.hpp>
 #include <com/sun/star/document/XDocumentSubStorageSupplier.hpp>
-#include <com/sun/star/embed/XStorage.hpp>
-#include <com/sun/star/embed/ElementModes.hpp>
 #include <hsqldb/HStorageAccess.hxx>
 #include <hsqldb/HStorageMap.hxx>
 
-#include <jvmaccess/virtualmachine.hxx>
-#include <com/sun/star/lang/XSingleComponentFactory.hpp>
-
 using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::document;
diff --git a/connectivity/source/drivers/jdbc/Array.cxx b/connectivity/source/drivers/jdbc/Array.cxx
index a45961ff8cae..d03b019283d2 100644
--- a/connectivity/source/drivers/jdbc/Array.cxx
+++ b/connectivity/source/drivers/jdbc/Array.cxx
@@ -19,7 +19,7 @@
 
 #include <java/sql/Array.hxx>
 #include <java/tools.hxx>
-#include <java/sql/ResultSet.hxx>
+#include <osl/diagnose.h>
 
 using namespace connectivity;
 
diff --git a/connectivity/source/drivers/jdbc/Blob.cxx b/connectivity/source/drivers/jdbc/Blob.cxx
index 22436a3dc282..adacd5d7c166 100644
--- a/connectivity/source/drivers/jdbc/Blob.cxx
+++ b/connectivity/source/drivers/jdbc/Blob.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <java/sql/Blob.hxx>
-#include <java/tools.hxx>
 #include <java/io/InputStream.hxx>
 #include <connectivity/dbexception.hxx>
 #include <osl/diagnose.h>
diff --git a/connectivity/source/drivers/jdbc/Class.cxx b/connectivity/source/drivers/jdbc/Class.cxx
index c4dc3f4b5286..98d37fbcc99f 100644
--- a/connectivity/source/drivers/jdbc/Class.cxx
+++ b/connectivity/source/drivers/jdbc/Class.cxx
@@ -18,7 +18,6 @@
  */
 
 #include <java/lang/Class.hxx>
-#include <java/tools.hxx>
 #include <rtl/ustring.hxx>
 
 using namespace connectivity;
diff --git a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
index 28ca22893e62..e1918d11c58d 100644
--- a/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/DatabaseMetaData.cxx
@@ -24,7 +24,6 @@
 #include <java/sql/SQLException.hxx>
 #include <java/tools.hxx>
 #include <java/lang/String.hxx>
-#include <connectivity/CommonTools.hxx>
 #include <FDatabaseMetaDataResultSet.hxx>
 #include <comphelper/types.hxx>
 #include <TPrivilegesResultSet.hxx>
diff --git a/connectivity/source/drivers/jdbc/Date.cxx b/connectivity/source/drivers/jdbc/Date.cxx
index 72efea3c89c1..8adaf455aeb0 100644
--- a/connectivity/source/drivers/jdbc/Date.cxx
+++ b/connectivity/source/drivers/jdbc/Date.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <java/util/Date.hxx>
-#include <java/tools.hxx>
+
 using namespace connectivity;
 
 //************ Class: java.util.Date
diff --git a/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx b/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx
index b6dc17062cf6..9c33eeb605d0 100644
--- a/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx
+++ b/connectivity/source/drivers/jdbc/DriverPropertyInfo.cxx
@@ -18,14 +18,9 @@
  */
 
 #include <java/sql/DriverPropertyInfo.hxx>
-#include <java/lang/Boolean.hxx>
-#include <java/tools.hxx>
-#include <java/lang/String.hxx>
 
 using namespace connectivity;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::lang;
 
 
diff --git a/connectivity/source/drivers/jdbc/InputStream.cxx b/connectivity/source/drivers/jdbc/InputStream.cxx
index d21792e2c830..c384760b3a26 100644
--- a/connectivity/source/drivers/jdbc/InputStream.cxx
+++ b/connectivity/source/drivers/jdbc/InputStream.cxx
@@ -22,7 +22,6 @@
 
 #include <com/sun/star/io/BufferSizeExceededException.hpp>
 #include <java/io/InputStream.hxx>
-#include <java/tools.hxx>
 #include <osl/diagnose.h>
 
 #include <string.h>
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
index bc2e2ad18d66..6def8948abee 100644
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ b/connectivity/source/drivers/jdbc/JConnection.cxx
@@ -29,10 +29,8 @@
 #include <java/sql/PreparedStatement.hxx>
 #include <java/sql/CallableStatement.hxx>
 #include <java/sql/SQLWarning.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/sdbc/SQLWarning.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
-#include <connectivity/sqlparse.hxx>
 #include <connectivity/dbexception.hxx>
 #include <java/util/Property.hxx>
 #include <java/LocalRef.hxx>
@@ -40,7 +38,6 @@
 #include <jvmaccess/classpath.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 #include <cppuhelper/exc_hlp.hxx>
-#include <rtl/ustrbuf.hxx>
 #include <jni.h>
 #include <strings.hrc>
 #include <unotools/confignode.hxx>
diff --git a/connectivity/source/drivers/jdbc/JDriver.cxx b/connectivity/source/drivers/jdbc/JDriver.cxx
index 4934deb0d199..3ec181bb305d 100644
--- a/connectivity/source/drivers/jdbc/JDriver.cxx
+++ b/connectivity/source/drivers/jdbc/JDriver.cxx
@@ -18,12 +18,7 @@
  */
 
 #include <java/sql/Driver.hxx>
-#include <java/lang/Object.hxx>
-#include <java/lang/Class.hxx>
-#include <java/sql/DriverPropertyInfo.hxx>
 #include <java/sql/Connection.hxx>
-#include <java/util/Property.hxx>
-#include <java/tools.hxx>
 #include <sal/log.hxx>
 #include <connectivity/dbexception.hxx>
 #include <jvmfwk/framework.hxx>
diff --git a/connectivity/source/drivers/jdbc/JStatement.cxx b/connectivity/source/drivers/jdbc/JStatement.cxx
index 72f205995639..32ffe22a4897 100644
--- a/connectivity/source/drivers/jdbc/JStatement.cxx
+++ b/connectivity/source/drivers/jdbc/JStatement.cxx
@@ -34,7 +34,6 @@
 #include <tools/diagnose_ex.h>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
 
 #include <strings.hxx>
 
diff --git a/connectivity/source/drivers/jdbc/Object.cxx b/connectivity/source/drivers/jdbc/Object.cxx
index 7b452a1947d9..479699750e07 100644
--- a/connectivity/source/drivers/jdbc/Object.cxx
+++ b/connectivity/source/drivers/jdbc/Object.cxx
@@ -17,15 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <java/lang/Class.hxx>
 #include <connectivity/CommonTools.hxx>
-#include <com/sun/star/uno/Exception.hpp>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <com/sun/star/logging/LogLevel.hpp>
 #include <java/tools.hxx>
 #include <java/sql/SQLException.hxx>
 #include <osl/diagnose.h>
-#include <osl/thread.h>
 #include <java/LocalRef.hxx>
 #include <strings.hxx>
 
diff --git a/connectivity/source/drivers/jdbc/Ref.cxx b/connectivity/source/drivers/jdbc/Ref.cxx
index bde596267d04..ca8e2e112815 100644
--- a/connectivity/source/drivers/jdbc/Ref.cxx
+++ b/connectivity/source/drivers/jdbc/Ref.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <java/sql/Ref.hxx>
-#include <java/tools.hxx>
+
 using namespace connectivity;
 
 //************ Class: java.sql.Ref
diff --git a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
index 691a136e4a2f..fdf5bfe69c29 100644
--- a/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
+++ b/connectivity/source/drivers/jdbc/ResultSetMetaData.cxx
@@ -19,7 +19,6 @@
 
 #include <java/sql/ResultSetMetaData.hxx>
 #include <java/sql/Connection.hxx>
-#include <java/tools.hxx>
 
 using namespace connectivity;
 using namespace ::com::sun::star::uno;
diff --git a/connectivity/source/drivers/jdbc/SQLException.cxx b/connectivity/source/drivers/jdbc/SQLException.cxx
index 0bff0890572d..55bf0996c941 100644
--- a/connectivity/source/drivers/jdbc/SQLException.cxx
+++ b/connectivity/source/drivers/jdbc/SQLException.cxx
@@ -18,13 +18,10 @@
  */
 
 #include <java/sql/SQLException.hxx>
-#include <java/tools.hxx>
 
 using namespace connectivity;
 using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::beans;
 using namespace ::com::sun::star::sdbc;
-using namespace ::com::sun::star::container;
 using namespace ::com::sun::star::lang;
 
 //************ Class: java.sql.SQLException
diff --git a/connectivity/source/drivers/jdbc/Throwable.cxx b/connectivity/source/drivers/jdbc/Throwable.cxx
index e732d56b2892..c96f5532f38d 100644
--- a/connectivity/source/drivers/jdbc/Throwable.cxx
+++ b/connectivity/source/drivers/jdbc/Throwable.cxx
@@ -18,7 +18,7 @@
  */
 
 #include <java/lang/Throwable.hxx>
-#include <java/tools.hxx>
+
 using namespace connectivity;
 
 //************ Class: java.lang.Throwable
diff --git a/connectivity/source/drivers/jdbc/tools.cxx b/connectivity/source/drivers/jdbc/tools.cxx
index 1d737600024c..5021d653a889 100644
--- a/connectivity/source/drivers/jdbc/tools.cxx
+++ b/connectivity/source/drivers/jdbc/tools.cxx
@@ -19,10 +19,7 @@
 
 
 #include <string.h>
-#include <cstdarg>
 #include <java/tools.hxx>
-#include <java/lang/String.hxx>
-#include <java/lang/Class.hxx>
 #include <java/util/Property.hxx>
 #include <com/sun/star/sdbc/DriverPropertyInfo.hpp>
 #include <com/sun/star/sdbc/SQLException.hpp>
diff --git a/connectivity/source/drivers/mork/MColumnAlias.cxx b/connectivity/source/drivers/mork/MColumnAlias.cxx
index 9a716e3d7c34..e56c9a8442c0 100644
--- a/connectivity/source/drivers/mork/MColumnAlias.cxx
+++ b/connectivity/source/drivers/mork/MColumnAlias.cxx
@@ -19,15 +19,13 @@
 
 #include "MColumnAlias.hxx"
 
-#include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/container/XNameAccess.hpp>
 #include <officecfg/Office/DataAccess.hxx>
 
-#include <tools/diagnose_ex.h>
+#include <osl/diagnose.h>
 #include <sal/log.hxx>
 
 #include <algorithm>
-#include <functional>
 
 using namespace ::connectivity::mork;
 using namespace ::com::sun::star::uno;
diff --git a/connectivity/source/drivers/mork/MColumns.cxx b/connectivity/source/drivers/mork/MColumns.cxx
index 6b0b70842298..c9163a6ab96b 100644
--- a/connectivity/source/drivers/mork/MColumns.cxx
+++ b/connectivity/source/drivers/mork/MColumns.cxx
@@ -20,7 +20,6 @@
 #include "MColumns.hxx"
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <connectivity/sdbcx/VColumn.hxx>
-#include <connectivity/dbtools.hxx>
 
 using namespace connectivity::mork;
 using namespace connectivity::sdbcx;
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
index 490688df3c91..d832533ec07b 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaData.cxx
@@ -13,11 +13,9 @@
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
 #include <sal/log.hxx>
-#include <strings.hrc>
 #include <vector>
 
 #include "MDatabaseMetaDataHelper.hxx"
-#include <connectivity/dbtools.hxx>
 
 using namespace connectivity::mork;
 using namespace connectivity;
diff --git a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
index c8d2c15abe2c..ca699bafaefd 100644
--- a/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
+++ b/connectivity/source/drivers/mork/MDatabaseMetaDataHelper.cxx
@@ -13,15 +13,6 @@
 // do we need it?
 static ::osl::Mutex m_aMetaMutex;
 
-#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/uno/Exception.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/beans/Property.hpp>
-#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/beans/XPropertySetInfo.hpp>
-#include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/sdb/ErrorCondition.hpp>
-
 #include <sal/log.hxx>
 
 #include "MorkParser.hxx"
diff --git a/connectivity/source/drivers/mork/MQueryHelper.cxx b/connectivity/source/drivers/mork/MQueryHelper.cxx
index 9077f49f7cc1..aaf8cac6a682 100644
--- a/connectivity/source/drivers/mork/MQueryHelper.cxx
+++ b/connectivity/source/drivers/mork/MQueryHelper.cxx
@@ -23,12 +23,9 @@
 #include "MConnection.hxx"
 
 #include "MorkParser.hxx"
-#include <stdlib.h>
-#include <sstream>
 #include <string>
 #include <vector>
 #include <algorithm>
-#include <string.h>
 
 #include <strings.hrc>
 
diff --git a/connectivity/source/drivers/mork/MResultSetMetaData.cxx b/connectivity/source/drivers/mork/MResultSetMetaData.cxx
index d7a82dd95034..032d4d5d4494 100644
--- a/connectivity/source/drivers/mork/MResultSetMetaData.cxx
+++ b/connectivity/source/drivers/mork/MResultSetMetaData.cxx
@@ -18,10 +18,8 @@
  */
 
 #include <connectivity/dbexception.hxx>
-#include <connectivity/dbtools.hxx>
 #include <comphelper/types.hxx>
 #include <comphelper/extract.hxx>
-#include <cppuhelper/typeprovider.hxx>
 #include <tools/diagnose_ex.h>
 #include "MResultSetMetaData.hxx"
 #include <com/sun/star/sdbc/DataType.hpp>
diff --git a/connectivity/source/drivers/mork/MorkParser.cxx b/connectivity/source/drivers/mork/MorkParser.cxx
index 4d4c9a3bf6db..188f8e6fb492 100644
--- a/connectivity/source/drivers/mork/MorkParser.cxx
+++ b/connectivity/source/drivers/mork/MorkParser.cxx
@@ -35,13 +35,10 @@
 #include "MorkParser.hxx"
 #include <boost/io/ios_state.hpp>
 #include <stdlib.h>
-#include <sstream>
 #include <string>
 #include <string.h>
-#include <stdexcept>
 #include <fstream>
 #include <iostream>
-#include <algorithm>
 
 std::string const g_Empty = "";
 
diff --git a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
index a5cffdaa2d3e..8dc7768778af 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MMozillaBootstrap.cxx
@@ -22,7 +22,6 @@
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
 #include <cppuhelper/supportsservice.hxx>
 #include "MMozillaBootstrap.hxx"
-#include "MNSFolders.hxx"
 #include "MNSProfileDiscover.hxx"
 
 using namespace com::sun::star::uno;
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
index 07376ab262f7..8e96aca34d8e 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSFolders.cxx
@@ -20,8 +20,6 @@
 #include "MNSFolders.hxx"
 
 #ifdef UNIX
-#include <sys/types.h>
-#include <strings.h>
 #include <string.h>
 #endif // End UNIX
 
diff --git a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
index 8d9277f99ed8..ae775b6fca01 100644
--- a/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
+++ b/connectivity/source/drivers/mozab/bootstrap/MNSINIParser.cxx
@@ -19,7 +19,7 @@
 
 #include "MNSINIParser.hxx"
 #include <com/sun/star/io/IOException.hpp>
-#include <osl/process.h>
+#include <osl/file.h>
 #include <rtl/byteseq.hxx>
 #include <sal/log.hxx>
 
diff --git a/connectivity/source/drivers/mysql_jdbc/YTable.cxx b/connectivity/source/drivers/mysql_jdbc/YTable.cxx
index 0db740478993..6603238ea6dc 100644
--- a/connectivity/source/drivers/mysql_jdbc/YTable.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YTable.cxx
@@ -17,17 +17,10 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <string.h>
 #include <mysql/YTable.hxx>
 #include <mysql/YTables.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
 #include <cppuhelper/typeprovider.hxx>
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbcx/Privilege.hpp>
 #include <comphelper/property.hxx>
 #include <comphelper/servicehelper.hxx>
@@ -36,8 +29,6 @@
 #include <connectivity/sdbcx/VColumn.hxx>
 #include <connectivity/TKeys.hxx>
 #include <connectivity/TIndexes.hxx>
-#include <connectivity/TColumnsHelper.hxx>
-#include <mysql/YCatalog.hxx>
 #include <mysql/YColumns.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/mysql_jdbc/YTables.cxx b/connectivity/source/drivers/mysql_jdbc/YTables.cxx
index 0ef8fff9033d..83b60fff5f15 100644
--- a/connectivity/source/drivers/mysql_jdbc/YTables.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YTables.cxx
@@ -22,14 +22,9 @@
 #include <mysql/YTable.hxx>
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbcx/Privilege.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
 #include <mysql/YCatalog.hxx>
 #include <connectivity/dbtools.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/interfacecontainer.h>
 #include <comphelper/types.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/mysql_jdbc/YUsers.cxx b/connectivity/source/drivers/mysql_jdbc/YUsers.cxx
index 5b29ce4ee7c9..17fc788179c1 100644
--- a/connectivity/source/drivers/mysql_jdbc/YUsers.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YUsers.cxx
@@ -19,12 +19,8 @@
 
 #include <mysql/YUsers.hxx>
 #include <mysql/YUser.hxx>
-#include <mysql/YTable.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
 #include <connectivity/sdbcx/IRefreshable.hxx>
 #include <comphelper/types.hxx>
-#include <connectivity/dbexception.hxx>
 #include <connectivity/dbtools.hxx>
 #include <TConnection.hxx>
 
diff --git a/connectivity/source/drivers/mysql_jdbc/YViews.cxx b/connectivity/source/drivers/mysql_jdbc/YViews.cxx
index 96a5c7db9e2c..4393ba0a566b 100644
--- a/connectivity/source/drivers/mysql_jdbc/YViews.cxx
+++ b/connectivity/source/drivers/mysql_jdbc/YViews.cxx
@@ -19,16 +19,8 @@
 
 #include <mysql/YViews.hxx>
 #include <mysql/YTables.hxx>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/XResultSet.hpp>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbcx/KeyType.hpp>
-#include <com/sun/star/sdbcx/CheckOption.hpp>
 #include <mysql/YCatalog.hxx>
 #include <connectivity/dbtools.hxx>
-#include <connectivity/dbexception.hxx>
-#include <cppuhelper/interfacecontainer.h>
 #include <connectivity/sdbcx/VView.hxx>
 #include <comphelper/types.hxx>
 #include <TConnection.hxx>
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
index 6513f4f94129..1070dd1fd68f 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_connection.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <memory>
 #include "mysqlc_connection.hxx"
 #include "mysqlc_databasemetadata.hxx"
 
@@ -26,25 +25,13 @@
 #include "mysqlc_preparedstatement.hxx"
 #include "mysqlc_general.hxx"
 
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/beans/NamedValue.hpp>
 
-#include <osl/module.hxx>
-#include <osl/thread.h>
-#include <osl/file.h>
-#include <sal/log.hxx>
 #include <osl/diagnose.h>
-#include <rtl/uri.hxx>
-#include <rtl/ustrbuf.hxx>
 #include <cppuhelper/supportsservice.hxx>
 
 using namespace connectivity::mysqlc;
 
-#include <stdio.h>
-
 using namespace com::sun::star::uno;
 using namespace com::sun::star::container;
 using namespace com::sun::star::lang;
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
index d9c7f81f9139..c9814a9da659 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_databasemetadata.cxx
@@ -17,29 +17,18 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include "mysqlc_databasemetadata.hxx"
-#include <memory>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
 #include <com/sun/star/sdbc/Deferrability.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
-#include <com/sun/star/sdbc/BestRowScope.hpp>
-#include <com/sun/star/sdbc/ColumnType.hpp>
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <comphelper/sequence.hxx>
 
 #include <sal/log.hxx>
 #include <rtl/ustrbuf.hxx>
 #include "mysqlc_general.hxx"
-#include "mysqlc_statement.hxx"
 #include "mysqlc_driver.hxx"
 #include "mysqlc_preparedstatement.hxx"
 
-#include <stdio.h>
-#include <sal/macros.h>
-
 using namespace connectivity::mysqlc;
 using namespace com::sun::star::uno;
 using namespace com::sun::star::lang;
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx b/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx
index 44a4367a793d..10ca352eb10f 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_driver.cxx
@@ -18,7 +18,6 @@
  */
 #include "mysqlc_driver.hxx"
 #include "mysqlc_connection.hxx"
-#include "mysqlc_general.hxx"
 
 using namespace css::uno;
 using namespace css::lang;
@@ -27,7 +26,6 @@ using namespace css::sdbc;
 using namespace connectivity::mysqlc;
 
 #include <cppuhelper/supportsservice.hxx>
-#include <stdio.h>
 
 MysqlCDriver::MysqlCDriver(const Reference<XMultiServiceFactory>& _rxFactory)
     : ODriver_BASE(m_aMutex)
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
index ace91d112210..90995ad31315 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_general.cxx
@@ -17,11 +17,12 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 #include "mysqlc_general.hxx"
-#include "mysqlc_resultsetmetadata.hxx"
 
 #include <sal/log.hxx>
 #include <rtl/ustring.hxx>
 
+#include <com/sun/star/sdbc/DataType.hpp>
+
 using com::sun::star::sdbc::SQLException;
 
 using com::sun::star::uno::Any;
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
index bfba7745856e..c26a84145a0c 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_prepared_resultset.cxx
@@ -23,8 +23,6 @@
 #include "mysqlc_resultsetmetadata.hxx"
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
@@ -34,7 +32,6 @@
 #include <sal/log.hxx>
 
 using namespace rtl;
-#include <comphelper/string.hxx>
 
 #include <cstdlib>
 
@@ -52,8 +49,6 @@ using namespace com::sun::star::util;
 using namespace ::comphelper;
 using ::osl::MutexGuard;
 
-#include <stdio.h>
-#include <typeinfo>
 #include <typeindex>
 
 namespace
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
index 68911564e1ec..d105365e39b1 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_preparedstatement.cxx
@@ -25,9 +25,7 @@
 
 #include <sal/log.hxx>
 
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <cppuhelper/typeprovider.hxx>
 
 #include <stdio.h>
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
index 8e2dc3f1144e..1168d79470cb 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultset.cxx
@@ -23,8 +23,6 @@
 #include "mysqlc_resultsetmetadata.hxx"
 
 #include <com/sun/star/beans/PropertyAttribute.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/FetchDirection.hpp>
@@ -33,12 +31,7 @@
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/seqstream.hxx>
 
-#include <sal/log.hxx>
-
 using namespace rtl;
-#include <comphelper/string.hxx>
-
-#include <cstdlib>
 
 using namespace connectivity::mysqlc;
 using namespace cppu;
@@ -54,8 +47,6 @@ using namespace com::sun::star::util;
 using namespace ::comphelper;
 using ::osl::MutexGuard;
 
-#include <stdio.h>
-
 namespace
 {
 // copied from string misc, it should be replaced when library is not an
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx b/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
index 3edcaeaab5de..ab9c2fb39992 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_resultsetmetadata.cxx
@@ -18,12 +18,10 @@
  */
 
 #include "mysqlc_resultsetmetadata.hxx"
-#include "mysqlc_resultset.hxx"
 #include "mysqlc_general.hxx"
 
 #include <com/sun/star/sdbc/XRow.hpp>
 #include <rtl/ustrbuf.hxx>
-#include <sal/log.hxx>
 
 using namespace connectivity::mysqlc;
 using namespace com::sun::star::uno;
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_services.cxx b/connectivity/source/drivers/mysqlc/mysqlc_services.cxx
index b0f7d0adc7c1..de611375c371 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_services.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_services.cxx
@@ -20,7 +20,6 @@
 #include "mysqlc_driver.hxx"
 
 #include <cppuhelper/factory.hxx>
-#include <rtl/ustrbuf.hxx>
 #include <uno/lbnames.h>
 #include <com/sun/star/lang/XSingleServiceFactory.hpp>
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
index edea5b82a03e..5444389ec17a 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_statement.cxx
@@ -19,24 +19,15 @@
 
 #include <sal/config.h>
 
-#include <memory>
-#include <stdio.h>
-
 #include "mysqlc_connection.hxx"
 #include "mysqlc_propertyids.hxx"
 #include "mysqlc_resultset.hxx"
 #include "mysqlc_statement.hxx"
 #include "mysqlc_general.hxx"
 
-#include <com/sun/star/lang/DisposedException.hpp>
-#include <com/sun/star/sdbc/FetchDirection.hpp>
-#include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
-#include <com/sun/star/sdbc/ResultSetType.hpp>
-
 #include <cppuhelper/typeprovider.hxx>
 #include <cppuhelper/queryinterface.hxx>
 #include <cppuhelper/supportsservice.hxx>
-#include <osl/thread.h>
 
 using namespace connectivity::mysqlc;
 
diff --git a/connectivity/source/drivers/mysqlc/mysqlc_types.cxx b/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
index 9639a4a6f381..219e0d553d41 100644
--- a/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
+++ b/connectivity/source/drivers/mysqlc/mysqlc_types.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <stdio.h>
 #include <com/sun/star/sdbc/DataType.hpp>
 #include <com/sun/star/sdbc/ColumnValue.hpp>
 #include <com/sun/star/sdbc/ColumnSearch.hpp>
diff --git a/connectivity/source/drivers/odbc/OConnection.cxx b/connectivity/source/drivers/odbc/OConnection.cxx
index 4017a0c66041..04bb0e1a51a2 100644
--- a/connectivity/source/drivers/odbc/OConnection.cxx
+++ b/connectivity/source/drivers/odbc/OConnection.cxx
@@ -24,11 +24,7 @@
 #include <odbc/ODriver.hxx>
 #include <odbc/OStatement.hxx>
 #include <odbc/OPreparedStatement.hxx>
-#include <com/sun/star/sdbc/ColumnValue.hpp>
-#include <com/sun/star/sdbc/XRow.hpp>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <connectivity/dbcharset.hxx>
-#include <connectivity/FValue.hxx>
 #include <connectivity/dbexception.hxx>
 
 #include <sal/log.hxx>
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
index 1f2ba68b02a0..c9ed165a8c26 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaData.cxx
@@ -25,9 +25,7 @@
 #include <com/sun/star/sdbc/ResultSetType.hpp>
 #include <com/sun/star/sdbc/ResultSetConcurrency.hpp>
 #include <com/sun/star/sdbc/TransactionIsolation.hpp>
-#include <connectivity/odbc.hxx>
 #include <TPrivilegesResultSet.hxx>
-#include <connectivity/dbexception.hxx>
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
 
diff --git a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
index fe3cd5646cee..7afd4bed54f9 100644
--- a/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/drivers/odbc/ODatabaseMetaDataResultSet.cxx
@@ -21,17 +21,12 @@
 
 #include <odbc/ODatabaseMetaDataResultSet.hxx>
 #include <com/sun/star/sdbc/DataType.hpp>
-#include <com/sun/star/sdbc/KeyRule.hpp>
-#include <com/sun/star/sdbc/ProcedureResult.hpp>
-#include <com/sun/star/sdbc/IndexType.hpp>
 #include <comphelper/property.hxx>
-#include <com/sun/star/lang/DisposedException.hpp>
 #include <cppuhelper/typeprovider.hxx>
 #include <comphelper/sequence.hxx>

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list