[Libreoffice-commits] core.git: Branch 'aoo/trunk' - 8 commits - binaryurp/source connectivity/java connectivity/prj editeng/source offapi/com offapi/UnoApi_offapi.mk oowintool postprocess/packregistry scp2/source scripting/java sc/source sfx2/inc sfx2/source solenv/gbuild solenv/inc svtools/source xmerge/source

Damjan Jovanovic damjan at apache.org
Fri Nov 10 18:03:09 UTC 2017


 binaryurp/source/lessoperators.cxx                                                                                |    2 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java                 |  239 +
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java          |    8 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java    |   86 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java                |   92 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java                      |  168 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java                   |  102 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java           |  225 +
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DBTypeConversion.java                  |    4 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java         |    8 
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java                           |  184 +
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java                      |  186 +
 connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java                         |   61 
 connectivity/java/sdbc_jdbc/build.xml                                                                             |  250 +
 connectivity/java/sdbc_jdbc/jdbc.component                                                                        |   30 
 connectivity/java/sdbc_jdbc/jdbc.xml                                                                              |   50 
 connectivity/java/sdbc_jdbc/makefile.mk                                                                           |   50 
 connectivity/java/sdbc_jdbc/sdbc_jdbc.xcu                                                                         |  215 +
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/BoundedInputStream.java                                    |   69 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ClassMap.java                                              |  167 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ConnectionLog.java                                         |   70 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ContextClassLoaderScope.java                               |   37 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JDBCDriver.java                                            |  196 +
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLArray.java                                          |  115 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLBlob.java                                           |  109 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java                              |  345 +
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLClob.java                                           |  109 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java                                     |  633 +++
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java                               | 1750 ++++++++++
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLPreparedStatement.java                              |  467 ++
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLRef.java                                            |   42 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java                                      |  926 +++++
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java                              |  260 +
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLStatement.java                                      |  161 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLStatementBase.java                                  |  515 ++
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ReaderInputStream.java                                     |   84 
 connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/Tools.java                                                 |   72 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDatabaseMetaDataResultSet.java |   46 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDatabaseMetadata.java          |    4 
 connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java                     |    2 
 connectivity/prj/build.lst                                                                                        |    2 
 connectivity/prj/d.lst                                                                                            |    2 
 editeng/source/accessibility/AccessibleStaticTextBase.cxx                                                         |    2 
 offapi/UnoApi_offapi.mk                                                                                           |    1 
 offapi/com/sun/star/sdb/ParameterSubstitution.idl                                                                 |   71 
 oowintool                                                                                                         |    3 
 postprocess/packregistry/makefile.mk                                                                              |    2 
 sc/source/core/data/documen2.cxx                                                                                  |    6 
 scp2/source/ooo/file_library_ooo.scp                                                                              |    7 
 scp2/source/ooo/file_ooo.scp                                                                                      |    8 
 scp2/source/ooo/module_hidden_ooo.scp                                                                             |    2 
 scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java                                                   |    2 
 sfx2/inc/sfx2/linkmgr.hxx                                                                                         |   10 
 sfx2/source/appl/linkmgr2.cxx                                                                                     |   66 
 solenv/gbuild/JunitTest.mk                                                                                        |    4 
 solenv/inc/javaunittest.mk                                                                                        |   11 
 svtools/source/dialogs/addresstemplate.cxx                                                                        |    3 
 xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java             |    2 
 58 files changed, 8206 insertions(+), 137 deletions(-)

New commits:
commit 0f76ba8b684aa6a71f61957a98003b0bd4c39a18
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Fri Nov 10 01:31:17 2017 +0000

    Use Hamcrest in dmake subsequent tests too.
    
    Patch by: me

diff --git a/solenv/inc/javaunittest.mk b/solenv/inc/javaunittest.mk
index 8e7a569b7cf4..f8c8a9e44bb1 100644
--- a/solenv/inc/javaunittest.mk
+++ b/solenv/inc/javaunittest.mk
@@ -50,6 +50,9 @@
 
 JAVAFILES +:= $(JAVATESTFILES)
 EXTRAJARFILES += $(OOO_JUNIT_JAR)
+.IF "$(HAMCREST_CORE_JAR)" != ""
+EXTRAJARFILES += $(HAMCREST_CORE_JAR)
+.END
 
 .INCLUDE: settings.mk
 
@@ -73,11 +76,19 @@ ALLTAR : test
 .END
 
 .IF "$(SOLAR_JAVA)" == "TRUE" && "$(OOO_JUNIT_JAR)" != ""
+.IF "$(HAMCREST_CORE_JAR)" != ""
+test .PHONY : $(JAVATARGET)
+    $(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
+        '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(HAMCREST_CORE_JAR)$(PATH_SEPARATOR)$(CLASSPATH)' \
+        org.junit.runner.JUnitCore \
+        $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(i:s/.java//))
+.ELSE
 test .PHONY : $(JAVATARGET)
     $(JAVAI) $(JAVAIFLAGS) $(JAVACPS) \
         '$(OOO_JUNIT_JAR)$(PATH_SEPERATOR)$(CLASSPATH)' \
         org.junit.runner.JUnitCore \
         $(foreach,i,$(JAVATESTFILES) $(subst,/,. $(PACKAGE)).$(i:s/.java//))
+.END
 .ELSE
 test .PHONY :
     echo 'test needs SOLAR_JAVA=TRUE and OOO_JUNIT_JAR'
commit 090fa571e318b913601e01266d980f863ebc6f99
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Fri Nov 10 01:18:59 2017 +0000

    Only specify Hamcrest in the classpath during subsequent tests
    
    if it's been specified.
    
    Patch by: me

diff --git a/solenv/gbuild/JunitTest.mk b/solenv/gbuild/JunitTest.mk
index 3b85dd56e518..3be0c76381dd 100644
--- a/solenv/gbuild/JunitTest.mk
+++ b/solenv/gbuild/JunitTest.mk
@@ -46,7 +46,11 @@ $(call gb_JunitTest_get_target,%) :
 	$(CLEAN_CMD)
 
 define gb_JunitTest_JunitTest
+ifeq ($(HAMCREST_CORE_JAR),)
+$(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib
+else
 $(call gb_JunitTest_get_target,$(1)) : CLASSPATH := $(value XCLASSPATH)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(call gb_JunitTest_get_classsetname,$(1)))$(gb_CLASSPATHSEP)$(OOO_JUNIT_JAR)$(gb_CLASSPATHSEP)$(HAMCREST_CORE_JAR)$(gb_CLASSPATHSEP)$(OUTDIR)/lib
+endif
 $(call gb_JunitTest_get_target,$(1)) : CLASSES :=
 $(call gb_JunitTest_JunitTest_platform,$(1))
 
commit c21530c98020d7610d60f4ca11025d537dbd435f
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Thu Nov 9 17:58:57 2017 +0000

    Add Java 8 to the JDKs known to oowintool,
    
    and clean up error reporting so ./configure looks better
    (no "use of undefined" errors).
    
    Patch by: me

diff --git a/oowintool b/oowintool
index 6c80a9a52f5a..2b8f271bbd8c 100755
--- a/oowintool
+++ b/oowintool
@@ -266,17 +266,20 @@ sub print_dotnetsdk_dir()
     my $dir = 
           reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv1.1") ||
           reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETFramework/sdkInstallRootv2.0");
+    defined $dir || exit 1;
     print cygpath ($dir, 'w', $output_format);
 }
 
 sub print_jdk_dir()
 {
     my $dir =
+	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.8/JavaHome") ||
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.7/JavaHome") ||
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.6/JavaHome") ||
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.5/JavaHome") ||
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.4/JavaHome") ||
 	  reg_get_value ("HKEY_LOCAL_MACHINE/SOFTWARE/JavaSoft/Java\ Development\ Kit/1.3/JavaHome");
+    defined $dir || exit 1;
     print cygpath($dir, 'w', $output_format); 
 }
 
commit 0bce5770176d642c311faf54f6fc5719ad713b23
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Thu Nov 9 05:54:17 2017 +0000

    #127044# - Defects in the code
    
    Commit fixes for sub-issues 1, 2, 5, 9 and 10.
    
    Found by: AppChecker <appchecker at cnpo.ru>
    Patch by: me

diff --git a/binaryurp/source/lessoperators.cxx b/binaryurp/source/lessoperators.cxx
index b4fb149f80de..80945f13975c 100644
--- a/binaryurp/source/lessoperators.cxx
+++ b/binaryurp/source/lessoperators.cxx
@@ -40,7 +40,7 @@ bool operator<( const TypeDescription& rLeft, const TypeDescription& rRight) {
     OSL_ASSERT( rLeft.is() && rRight.is());
     const typelib_TypeDescription& rA = *rLeft.get();
     const typelib_TypeDescription& rB = *rRight.get();
-    if( rA.eTypeClass != rA.eTypeClass)
+    if( rA.eTypeClass != rB.eTypeClass)
         return (rA.eTypeClass < rB.eTypeClass);
     const sal_Int32 nCmp = rtl_ustr_compare_WithLength(
             rA.pTypeName->buffer, rA.pTypeName->length,
diff --git a/editeng/source/accessibility/AccessibleStaticTextBase.cxx b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
index a2ea3248f0b6..85288a2cfdff 100644
--- a/editeng/source/accessibility/AccessibleStaticTextBase.cxx
+++ b/editeng/source/accessibility/AccessibleStaticTextBase.cxx
@@ -360,7 +360,7 @@ sal_Unicode cNewLine(0x0a);
     {
         // Keep 'invalid' values at the TextSegment
         if( aTextSegment.SegmentStart != -1 &&
-            aTextSegment.SegmentStart != -1 )
+            aTextSegment.SegmentEnd != -1 )
         {
             // #112814# Correct TextSegment by paragraph offset
             sal_Int32 nOffset(0);
diff --git a/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java b/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
index 02b4a03ab0f0..95f5e54948b9 100644
--- a/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
+++ b/scripting/java/org/openoffice/idesupport/ui/ConfigurePanel.java
@@ -91,7 +91,7 @@ public class ConfigurePanel extends JPanel {
             this.classpath = classpath;
 
         if (descriptor != null) {
-            descriptor = descriptor;
+            this.descriptor = descriptor;
         }
 
         methodPanel.reload(this.basedir, this.classpath,
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 8f9e66a1f487..0b73ed8120fc 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -184,7 +184,8 @@ public:
 
         // loop throuzh the given names
         const AliasProgrammaticPair* pFields = _rFields.getConstArray();
-        for (;pFields != pFields; ++pFields)
+        const AliasProgrammaticPair* pEnd = pFields + _rFields.getLength();
+        for (;pFields != pEnd; ++pFields)
         {
             StringBagIterator aKnownPos = aKnownNames.find( pFields->ProgrammaticName );
             if ( aKnownNames.end() != aKnownPos )
diff --git a/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java b/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java
index c7b036323e39..52cbb62de0dc 100644
--- a/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java
+++ b/xmerge/source/pexcel/java/org/openoffice/xmerge/converter/xml/sxc/pexcel/records/FontDescription.java
@@ -159,7 +159,7 @@ public class FontDescription implements BIFFRecord {
             return false;
 
         if (EndianConverter.readShort(dwHeight) !=
-        EndianConverter.readShort(dwHeight))
+        EndianConverter.readShort(rhs.dwHeight))
             return false;
 
         if (this.getFont() != rhs.getFont())
commit 4ec4c84d175c5ede2a8b5f387c5639a1498917af
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Thu Nov 9 02:13:13 2017 +0000

    UNO hates null strings, and the C++ implementation of the SDBC-JDBC bridge
    
    was converting nulls to empty strings, so do the same.
    
    Fix parsing strings into UNO timestamps.
    
    Dispose of all undisposed statements when the JDBC connection is disposed.
    
    Patch by: me

diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DBTypeConversion.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DBTypeConversion.java
index d3200b5ae486..44bcaf17a584 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DBTypeConversion.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DBTypeConversion.java
@@ -406,7 +406,9 @@ public class DBTypeConversion {
             if (dot >= 0) {
                 nSecond = (short)safeParseInt(secondAndNano.substring(0, dot));
                 String nano = secondAndNano.substring(dot + 1);
-                nano = nano.substring(0, 2);
+                if (nano.length() > 2) {
+                    nano = nano.substring(0, 2);
+                }
                 nano = nano + "00".substring(0, 2 - nano.length());
                 nHundredthSeconds = (short)safeParseInt(nano);
             } else {
diff --git a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java
index 4b094708e84e..dacfe2f68f70 100644
--- a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java
+++ b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java
@@ -120,7 +120,7 @@ public class JavaSQLCallableStatement extends JavaSQLPreparedStatement implement
             if (jdbcDate != null) {
                 return DBTypeConversion.toDate(jdbcDate.toString());
             } else {
-                return null;
+                return new Date();
             }
         } catch (java.sql.SQLException exception) {
             throw Tools.toUnoException(this, exception);
@@ -270,7 +270,12 @@ public class JavaSQLCallableStatement extends JavaSQLPreparedStatement implement
     public synchronized String getString(int columnIndex) throws SQLException {
         createStatement();
         try {
-            return ((java.sql.CallableStatement)jdbcStatement).getString(columnIndex);
+            String string = ((java.sql.CallableStatement)jdbcStatement).getString(columnIndex);
+            if (string != null) {
+                return string;
+            } else {
+                return "";
+            }
         } catch (java.sql.SQLException exception) {
             throw Tools.toUnoException(this, exception);
         }
diff --git a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java
index ee5145a45a35..e07844f690cb 100644
--- a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java
+++ b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java
@@ -20,8 +20,11 @@
  *************************************************************/
 package com.sun.star.comp.sdbc;
 
+import java.util.Iterator;
 import java.util.Properties;
+import java.util.Set;
 
+import org.apache.openoffice.comp.sdbc.dbtools.comphelper.CompHelper;
 import org.apache.openoffice.comp.sdbc.dbtools.util.AutoRetrievingBase;
 import org.apache.openoffice.comp.sdbc.dbtools.util.Resources;
 import org.apache.openoffice.comp.sdbc.dbtools.util.SharedResources;
@@ -85,6 +88,11 @@ public class JavaSQLConnection extends ComponentBase
     protected synchronized void postDisposing() {
         logger.log(LogLevel.INFO, Resources.STR_LOG_SHUTDOWN_CONNECTION);
         try {
+            for (Iterator<?> it = statements.keySet().iterator(); it.hasNext();) {
+                JavaSQLStatementBase statement = (JavaSQLStatementBase) it.next();
+                it.remove();
+                CompHelper.disposeComponent(statement);
+            }
             if (connection != null) {
                 connection.close();
             }
@@ -187,7 +195,12 @@ public class JavaSQLConnection extends ComponentBase
     public synchronized String getCatalog() throws SQLException {
         checkDisposed();
         try {
-            return connection.getCatalog();
+            String catalog = connection.getCatalog();
+            if (catalog != null) {
+                return catalog;
+            } else {
+                return "";
+            }
         } catch (java.sql.SQLException sqlException) {
             throw Tools.toUnoException(this, sqlException);
         }
@@ -243,6 +256,10 @@ public class JavaSQLConnection extends ComponentBase
         checkDisposed();
         try {
             String ret = connection.nativeSQL(sql);
+            if (ret == null) {
+                // UNO hates null strings
+                ret = "";
+            }
             logger.log(LogLevel.FINER, Resources.STR_LOG_NATIVE_SQL, sql, ret);
             return ret;
         } catch (java.sql.SQLException sqlException) {
diff --git a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java
index ea10a26d24f9..47fc290b8ab4 100644
--- a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java
+++ b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java
@@ -93,7 +93,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getCatalogSeparator() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getCatalogSeparator();
+            String catalogSeparator = jdbcDatabaseMetaData.getCatalogSeparator();
+            if (catalogSeparator == null) {
+                catalogSeparator = "";
+            }
+            return catalogSeparator;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -705,7 +709,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getCatalogTerm() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getCatalogTerm();
+            String catalogTerm = jdbcDatabaseMetaData.getCatalogTerm();
+            if (catalogTerm == null) {
+                catalogTerm = "";
+            }
+            return catalogTerm;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -714,7 +722,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getIdentifierQuoteString() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getIdentifierQuoteString();
+            String identifierQuoteString = jdbcDatabaseMetaData.getIdentifierQuoteString();
+            if (identifierQuoteString == null) {
+                identifierQuoteString = "";
+            }
+            return identifierQuoteString;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -723,7 +735,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getExtraNameCharacters() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getExtraNameCharacters();
+            String extraNameCharacters = jdbcDatabaseMetaData.getExtraNameCharacters();
+            if (extraNameCharacters == null) {
+                extraNameCharacters = "";
+            }
+            return extraNameCharacters;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1340,7 +1356,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getUserName() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getUserName();
+            String username = jdbcDatabaseMetaData.getUserName();
+            if (username == null) {
+                username = "";
+            }
+            return username;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1349,7 +1369,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getDriverName() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getDriverName();
+            String driverName = jdbcDatabaseMetaData.getDriverName();
+            if (driverName == null) {
+                driverName = "";
+            }
+            return driverName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1358,7 +1382,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getDriverVersion() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getDriverVersion();
+            String driverVersion = jdbcDatabaseMetaData.getDriverVersion();
+            if (driverVersion == null) {
+                driverVersion = "";
+            }
+            return driverVersion;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1367,7 +1395,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getDatabaseProductVersion() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getDatabaseProductVersion();
+            String databaseProductVersion = jdbcDatabaseMetaData.getDatabaseProductVersion();
+            if (databaseProductVersion == null) {
+                databaseProductVersion = "";
+            }
+            return databaseProductVersion;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1376,7 +1408,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getDatabaseProductName() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getDatabaseProductName();
+            String databaseProductName = jdbcDatabaseMetaData.getDatabaseProductName();
+            if (databaseProductName == null) {
+                databaseProductName = "";
+            }
+            return databaseProductName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1385,7 +1421,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getProcedureTerm() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getProcedureTerm();
+            String procedureTerm = jdbcDatabaseMetaData.getProcedureTerm();
+            if (procedureTerm == null) {
+                procedureTerm = "";
+            }
+            return procedureTerm;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1394,7 +1434,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getSchemaTerm() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getSchemaTerm();
+            String schemaTerm = jdbcDatabaseMetaData.getSchemaTerm();
+            if (schemaTerm == null) {
+                schemaTerm = "";
+            }
+            return schemaTerm;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1422,7 +1466,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getSQLKeywords() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getSQLKeywords();
+            String sqlKeywords = jdbcDatabaseMetaData.getSQLKeywords();
+            if (sqlKeywords == null) {
+                sqlKeywords = "";
+            }
+            return sqlKeywords;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1431,7 +1479,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getSearchStringEscape() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getSearchStringEscape();
+            String searchStringEscape = jdbcDatabaseMetaData.getSearchStringEscape();
+            if (searchStringEscape == null) {
+                searchStringEscape = "";
+            }
+            return searchStringEscape;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1440,7 +1492,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getStringFunctions() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getStringFunctions();
+            String stringFunctions = jdbcDatabaseMetaData.getStringFunctions();
+            if (stringFunctions == null) {
+                stringFunctions = "";
+            }
+            return stringFunctions;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1449,7 +1505,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getTimeDateFunctions() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getTimeDateFunctions();
+            String timeDateFunctions = jdbcDatabaseMetaData.getTimeDateFunctions();
+            if (timeDateFunctions == null) {
+                timeDateFunctions = "";
+            }
+            return timeDateFunctions;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1458,7 +1518,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getSystemFunctions() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getSystemFunctions();
+            String systemFunctions = jdbcDatabaseMetaData.getSystemFunctions();
+            if (systemFunctions == null) {
+                systemFunctions = "";
+            }
+            return systemFunctions;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -1467,7 +1531,11 @@ public class JavaSQLDatabaseMetaData extends WeakBase implements XDatabaseMetaDa
     @Override
     public String getNumericFunctions() throws SQLException {
         try {
-            return jdbcDatabaseMetaData.getNumericFunctions();
+            String numericFunctions = jdbcDatabaseMetaData.getNumericFunctions();
+            if (numericFunctions == null) {
+                numericFunctions = "";
+            }
+            return numericFunctions;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
diff --git a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java
index ac13c69d63b4..d203cdaae728 100644
--- a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java
+++ b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java
@@ -196,7 +196,11 @@ public class JavaSQLResultSet extends PropertySet
 
     private String getCursorName() throws WrappedTargetException {
         try {
-            return jdbcResultSet.getCursorName();
+            String cursorName = jdbcResultSet.getCursorName();
+            if (cursorName == null) {
+                cursorName = "";
+            }
+            return cursorName;
         } catch (java.sql.SQLException exception) {
             throw new WrappedTargetException("SQL error", this, Tools.toUnoException(this, exception));
         }
diff --git a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java
index dff85b8c2ae7..0f19ab6aedc4 100644
--- a/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java
+++ b/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java
@@ -77,7 +77,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getSchemaName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getSchemaName(column);
+            String schemaName = jdbcResultSetMetaData.getSchemaName(column);
+            if (schemaName == null) {
+                schemaName = "";
+            }
+            return schemaName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -86,7 +90,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getColumnName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getColumnName(column);
+            String columnName = jdbcResultSetMetaData.getColumnName(column);
+            if (columnName == null) {
+                columnName = "";
+            }
+            return columnName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -95,7 +103,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getTableName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getTableName(column);
+            String tableName = jdbcResultSetMetaData.getTableName(column);
+            if (tableName == null) {
+                tableName = "";
+            }
+            return tableName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -104,7 +116,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getCatalogName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getCatalogName(column);
+            String catalogName = jdbcResultSetMetaData.getCatalogName(column);
+            if (catalogName == null) {
+                catalogName = "";
+            }
+            return catalogName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -113,7 +129,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getColumnTypeName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getColumnTypeName(column);
+            String columnTypeName = jdbcResultSetMetaData.getColumnTypeName(column);
+            if (columnTypeName == null) {
+                columnTypeName = "";
+            }
+            return columnTypeName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -122,7 +142,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getColumnLabel(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getColumnLabel(column);
+            String columnLabel = jdbcResultSetMetaData.getColumnLabel(column);
+            if (columnLabel == null) {
+                columnLabel = "";
+            }
+            return columnLabel;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
@@ -131,7 +155,11 @@ public class JavaSQLResultSetMetaData extends WeakBase implements XResultSetMeta
     @Override
     public String getColumnServiceName(int column) throws SQLException {
         try {
-            return jdbcResultSetMetaData.getColumnClassName(column);
+            String columnServiceName = jdbcResultSetMetaData.getColumnClassName(column);
+            if (columnServiceName == null) {
+                columnServiceName = "";
+            }
+            return columnServiceName;
         } catch (java.sql.SQLException jdbcSQLException) {
             throw Tools.toUnoException(this, jdbcSQLException);
         }
commit b99e582c3d5d9f452b3fa648cfc85cc526bf0282
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Wed Nov 8 16:46:44 2017 +0000

    Add a file I missed out in my last commit.
    
    Patch by: me

diff --git a/offapi/com/sun/star/sdb/ParameterSubstitution.idl b/offapi/com/sun/star/sdb/ParameterSubstitution.idl
new file mode 100644
index 000000000000..40b1caf8078d
--- /dev/null
+++ b/offapi/com/sun/star/sdb/ParameterSubstitution.idl
@@ -0,0 +1,71 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+
+
+#ifndef __com_sun_star_sdb_ParameterSubstitution_idl__
+#define __com_sun_star_sdb_ParameterSubstitution_idl__
+
+ module com {  module sun {  module star {  module lang {
+ published interface XInitialization;
+ published interface XServiceInfo;
+};};};};
+
+module com { module sun { module star { module util {
+ published interface XStringSubstitution;
+};};};};
+
+#ifndef __com_sun_star_lang_XInitialization_idl__
+#include <com/sun/star/lang/XInitialization.idl>
+#endif
+
+#ifndef __com_sun_star_lang_XServiceInfo_idl__
+#include <com/sun/star/lang/XServiceInfo.idl>
+#endif
+
+#ifndef __com_sun_star_util_XStringSubstitution_idl__
+#include <com/sun/star/util/XStringSubstitution.idl>
+#endif
+
+ module com {  module sun {  module star {  module sdb {
+
+
+/** Does variable substitution on an SQL query.
+ */
+published service ParameterSubstitution
+{
+        /** must cary a live connection in the "ActiveConnection" property.
+          */
+    interface com::sun::star::lang::XInitialization;
+
+    interface com::sun::star::lang::XServiceInfo;
+
+    /** for the variable substitution.
+          */
+    interface com::sun::star::util::XStringSubstitution;
+};
+
+//=============================================================================
+
+}; }; }; };
+
+/*===========================================================================
+===========================================================================*/
+#endif
commit b487eaa65e2e67bc68d8b88d1fe6048f0189f22d
Author: Damjan Jovanovic <damjan at apache.org>
Date:   Wed Nov 8 04:17:25 2017 +0000

    Port our SDBC-JDBC bridge driver to Java. Supported interfaces,
    
    service names, implementation names, logging channels and messages,
    initialization arguments, and general behaviour is all preserved, so it
    should be completely transparent to client code.
    
    Allow PropertySetAdapter.getPropertyValue() to throw WrappedTargetException,
    and PropertySetAdapter.setPropertyValue() to throw PropertyVetoException,
    IllegalArgumentException, and WrappedTargetException, as these are
    sometimes used to change values in a database driver, which can fail.
    
    Port helper classes from main/comphelper for logging.
    
    Port AutoRetrievingBase.
    
    Add in-memory Column, ResultSet and metadata classes.
    
    Improve handling of Any in ORowSetValue.
    
    Move PostgreSQL's database metadata result set class to dbtools, and
    have it only override the method it needs.
    
    It's "information_schema" in PostgreSQL - "INFORMATION_SCHEMA"
    doesn't exist and gives an error.
    
    Add a new UNO service com.sun.star.sdb.ParameterSubstitution as was
    intended by main/connectivity/source/dbtools/dbtools.component
    that allow substituting parameters, so it can be used from Java.
    
    Keep the database drivers in a common install package.
    
    Patch by: me

diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
new file mode 100644
index 000000000000..97f2f1dddd0a
--- /dev/null
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
@@ -0,0 +1,239 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+package org.apache.openoffice.comp.sdbc.dbtools.comphelper;
+
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+import com.sun.star.logging.LogLevel;
+import com.sun.star.logging.XLogHandler;
+import com.sun.star.logging.XLogger;
+import com.sun.star.logging.XLoggerPool;
+import com.sun.star.uno.DeploymentException;
+import com.sun.star.uno.UnoRuntime;
+import com.sun.star.uno.XComponentContext;
+
+public class EventLogger {
+    protected XComponentContext context;
+    private String loggerName;
+    private XLogger logger;
+
+    public static XLoggerPool getLoggerPool(XComponentContext context) {
+        Object loggerPoolObject = context.getValueByName("/singletons/com.sun.star.logging.LoggerPool");
+        XLoggerPool loggerPool = UnoRuntime.queryInterface(XLoggerPool.class, loggerPoolObject);
+        if (loggerPool == null) {
+            throw new DeploymentException(
+                    "component context fails to supply singleton com.sun.star.logging.LoggerPool of type com.sun.star.logging.XLoggerPool",
+                    context);
+        }
+        return loggerPool;
+    }
+
+    public EventLogger(XComponentContext context) {
+        this(context, "");
+    }
+
+    /**
+     * Creates an <code>EventLogger</code> instance working with a css.logging.XLogger
+     * instance given by name.
+     *
+     * @param context
+     *    the component context to create services.
+     * @param loggerName
+     *    the name of the logger to create. If empty, the office-wide default logger will be used.
+     */
+    public EventLogger(XComponentContext context, String loggerName) {
+        this.context = context;
+        this.loggerName = loggerName;
+
+        try {
+            XLoggerPool loggerPool = getLoggerPool(context);
+            if (!loggerName.isEmpty()) {
+                logger = loggerPool.getNamedLogger(loggerName);
+            } else {
+                logger = loggerPool.getDefaultLogger();
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+    }
+
+    /**
+     * Returns the name of the logger
+     */
+    public String getName() {
+        return loggerName;
+    }
+
+    /// Returns the current log level threshold of the logger.
+    public int getLogLevel() {
+        try {
+            if (logger != null) {
+                return logger.getLevel();
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+        return LogLevel.OFF;
+    }
+
+    /// Sets a new log level threshold of the logger.
+    void setLogLevel(int logLevel) {
+        try {
+            if (logger != null) {
+                logger.setLevel(logLevel);
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+    }
+
+    /// Determines whether an event with the given level would be logged.
+    public boolean isLoggable(int logLevel) {
+        if (logger == null) {
+            return false;
+        }
+
+        try {
+            return logger.isLoggable(logLevel);
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+
+        return false;
+    }
+
+    /**
+     * Adds the given log handler to the logger's set of handlers.
+     *
+     * Note that normally, you would not use this method: The logger implementations
+     * initialize themselves from the configuration, where usually, a default log handler
+     * is specified. In this case, the logger will create and use this handler.
+     *
+     * @return
+     *   true if and only if the addition was successful (as far as this can be detected
+     *   from outside the <code>XLogger</code>'s implementation.
+     */
+    public boolean addLogHandler(XLogHandler logHandler) {
+        try {
+            if (logger != null) {
+                logger.addLogHandler(logHandler);
+                return true;
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+        return false;
+    }
+
+    /** removes the given log handler from the logger's set of handlers.
+     *
+     * @return
+     *   true if and only if the addition was successful (as far as this can be detected
+     *   from outside the <code>XLogger</code>'s implementation.
+     */
+    public boolean removeLogHandler(XLogHandler logHandler) {
+        try {
+            if (logger != null) {
+                logger.removeLogHandler(logHandler);
+                return true;
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+        return false;
+    }
+
+    /**
+     * Logs a given message with its arguments, without the caller's class and method.
+     * @param logLevel the log level
+     * @param message the message to log
+     * @param arguments the arguments to log, which are converted to strings and replace $1$, $2$, up to $n$ in the message
+     * @return whether logging succeeded
+     */
+    public boolean log(int logLevel, String message, Object... arguments) {
+        if (isLoggable(logLevel))
+            return impl_log(logLevel, null, null, message, arguments);
+        return false;
+    }
+
+    /**
+     * Logs the given exception.
+     * @param logLevel the log level
+     * @param exception the exception
+     * @return whether logging succeeded
+     */
+    public boolean log(int logLevel, Throwable exception) {
+        return log(logLevel, "", exception);
+    }
+
+    /**
+     * Logs the given message and exception.
+     * @param logLevel the log level
+     * @param message the message
+     * @param exception the exception
+     * @return whether logging succeeded
+     */
+    public boolean log(int logLevel, String message, Throwable exception) {
+        if (isLoggable(logLevel)) {
+            StringWriter stringWriter = new StringWriter();
+            PrintWriter printerWriter = new PrintWriter(stringWriter);
+            exception.printStackTrace(printerWriter);
+            message += "\n" + stringWriter.getBuffer().toString();
+            return impl_log(logLevel, null, null, message);
+        }
+        return true;
+    }
+
+    /**
+     * Logs a given message with its arguments, with the caller's class and method
+     * taken from a (relatively costly!) stack trace.
+     * @param logLevel the log level
+     * @param message the message to log
+     * @param arguments the arguments to log, which are converted to strings and replace $1$, $2$, up to $n$ in the message
+     * @return whether logging succeeded
+     */
+    public boolean logp(int logLevel, String message, Object...arguments) {
+        if (isLoggable(logLevel)) {
+            StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
+            return impl_log(logLevel, caller.getClassName(), caller.getMethodName(), message, arguments);
+        }
+        return false;
+    }
+
+    protected boolean impl_log(int logLevel, String sourceClass, String sourceMethod, String message, Object... arguments) {
+        if (logger == null) {
+            return false;
+        }
+        try {
+            for (int i = 0; i < arguments.length; i++) {
+                String placeholder = "$" + (i+1) + "$";
+                int position = message.indexOf(placeholder);
+                if (position >= 0) {
+                    message = message.substring(0, position) + arguments[i].toString() +
+                            message.substring(position + placeholder.length());
+                }
+            }
+
+            if (sourceClass != null && sourceMethod != null) {
+                logger.logp(logLevel, sourceClass, sourceMethod, message);
+            } else {
+                logger.log(logLevel, message);
+            }
+        } catch (com.sun.star.uno.RuntimeException exception) {
+        }
+        return true;
+    }
+}
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
index 66507bf47ad0..103288469acb 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
@@ -19,7 +19,7 @@
  *
  *************************************************************/
 
-package com.sun.star.sdbcx.comp.postgresql.comphelper;
+package org.apache.openoffice.comp.sdbc.dbtools.comphelper;
 
 import java.util.Arrays;
 import java.util.Comparator;
@@ -65,11 +65,11 @@ public class PropertySetAdapter implements XPropertySet, XFastPropertySet, XMult
     private final PropertySetInfo propertySetInfo = new PropertySetInfo();
 
     public static interface PropertyGetter {
-        Object getValue();
+        Object getValue() throws WrappedTargetException;
     }
 
     public static interface PropertySetter {
-        void setValue(Object value);
+        void setValue(Object value) throws PropertyVetoException, IllegalArgumentException, WrappedTargetException;
     }
 
     private static class PropertyData {
@@ -194,7 +194,7 @@ public class PropertySetAdapter implements XPropertySet, XFastPropertySet, XMult
         return propertyData;
     }
 
-    private Object getPropertyValue(PropertyData propertyData) {
+    private Object getPropertyValue(PropertyData propertyData) throws WrappedTargetException {
         Object ret;
         synchronized (lock) {
             ret = propertyData.getter.getValue();
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
new file mode 100644
index 000000000000..5664c4d8e223
--- /dev/null
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
@@ -0,0 +1,86 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+package org.apache.openoffice.comp.sdbc.dbtools.comphelper;
+
+import com.sun.star.lang.NullPointerException;
+import com.sun.star.uno.XComponentContext;
+
+public class ResourceBasedEventLogger extends EventLogger {
+    private String resourceBundleBaseName;
+    private OfficeResourceBundle resourceBundle;
+
+    public ResourceBasedEventLogger(XComponentContext context, String resourceBundleBaseName, String loggerName) {
+        super(context, loggerName);
+        this.resourceBundleBaseName = resourceBundleBaseName;
+        try {
+            resourceBundle = new OfficeResourceBundle(context, resourceBundleBaseName);
+        } catch (NullPointerException nullPointerException) {
+            throw new RuntimeException(nullPointerException);
+        }
+    }
+
+    public ResourceBasedEventLogger(ResourceBasedEventLogger logger) {
+        super(logger.context, logger.getName());
+        this.resourceBundleBaseName = logger.resourceBundleBaseName;
+        try {
+            resourceBundle = new OfficeResourceBundle(logger.context, logger.resourceBundleBaseName);
+        } catch (NullPointerException nullPointerException) {
+            throw new RuntimeException(nullPointerException);
+        }
+    }
+
+    /**
+     * Logs a given message with its arguments, without the caller's class and method.
+     * @param logLevel the log level
+     * @param messageResID the resource ID of the message to log
+     * @param arguments the arguments to log, which are converted to strings and replace $1$, $2$, up to $n$ in the message
+     * @return whether logging succeeded
+     */
+    public boolean log(int logLevel, int messageResID, Object... arguments) {
+        if (isLoggable(logLevel))
+            return impl_log(logLevel, null, null, loadStringMessage(messageResID), arguments);
+        return false;
+    }
+
+    /**
+     * Logs a given message with its arguments, with the caller's class and method
+     * taken from a (relatively costly!) stack trace.
+     * @param logLevel the log level
+     * @param messageResID the resource ID of the message to log
+     * @param arguments the arguments to log, which are converted to strings and replace $1$, $2$, up to $n$ in the message
+     * @return whether logging succeeded
+     */
+    public boolean logp(int logLevel, int messageResID, Object... arguments) {
+        if (isLoggable(logLevel)) {
+            StackTraceElement caller = Thread.currentThread().getStackTrace()[2];
+            return impl_log(logLevel, caller.getClassName(), caller.getMethodName(), loadStringMessage(messageResID), arguments);
+        }
+        return false;
+    }
+
+    private String loadStringMessage(int messageResID) {
+        String message = resourceBundle.loadString(messageResID);
+        if (message.isEmpty()) {
+            message = String.format("<invalid event resource: '%s:%d'>", resourceBundleBaseName, messageResID);
+        }
+        return message;
+    }
+}
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
new file mode 100644
index 000000000000..9ed4ce6369b5
--- /dev/null
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
@@ -0,0 +1,92 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+package org.apache.openoffice.comp.sdbc.dbtools.util;
+
+public class AutoRetrievingBase {
+    private String autoRetrievingStatement; // contains the statement which should be used when query for automatically generated values
+    private boolean autoRetrievingEnabled; // set to when we should allow to query for generated values
+
+    public boolean isAutoRetrievingEnabled() {
+        return autoRetrievingEnabled;
+    }
+
+    public String getAutoRetrievingStatement() {
+        return autoRetrievingStatement;
+    }
+
+    public void setAutoRetrievingEnabled(boolean autoRetrievingEnabled) {
+        this.autoRetrievingEnabled = autoRetrievingEnabled;
+    }
+
+    public void setAutoRetrievingStatement(String autoRetrivingStatement) {
+        this.autoRetrievingStatement = autoRetrivingStatement;
+    }
+
+    /** transform the statement to query for auto generated values
+     * @param  insertStatement
+     *     The "INSERT" statement, is used to query for column and table names
+     * @return
+     *     The transformed generated statement.
+     */
+    public String getTransformedGeneratedStatement(String insertStatement) {
+        Osl.ensure(autoRetrievingEnabled, "Illegal call here. isAutoRetrievingEnabled() is false!");
+         insertStatement = insertStatement.toUpperCase();
+         String statement = "";
+         if (insertStatement.startsWith("INSERT")) {
+             statement = autoRetrievingStatement;
+
+             int index = 0;
+             index = statement.indexOf("$column");
+             if (index != -1) {
+                 // we need a column
+                 // FIXME: do something?
+             }
+
+             index = statement.indexOf("$table");
+             if (index != -1) {
+                 // we need a table
+                 int intoIndex = insertStatement.indexOf("INTO ");
+                 insertStatement = insertStatement.substring(intoIndex + 5);
+
+                 int firstNonSpace;
+                 for (firstNonSpace = 0; firstNonSpace < insertStatement.length();) {
+                     int ch = insertStatement.codePointAt(firstNonSpace);
+                     if (ch != ' ') {
+                         break;
+                     }
+                     firstNonSpace += Character.charCount(ch);
+                 }
+                 insertStatement = insertStatement.substring(firstNonSpace);
+
+                 int nextSpace = insertStatement.indexOf(' ');
+                 String tableName;
+                 if (nextSpace >= 0) {
+                     tableName = insertStatement.substring(0, nextSpace);
+                 } else {
+                     tableName = "";
+                 }
+
+                 statement = statement.substring(0, index) + tableName + statement.substring(index + 6);
+             }
+         }
+         return statement;
+    }
+}
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
new file mode 100644
index 000000000000..98d423ffbf83
--- /dev/null
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
@@ -0,0 +1,168 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+package org.apache.openoffice.comp.sdbc.dbtools.util;
+
+public class CustomColumn {
+    private String catalogName = "";
+    private String schemaName = "";
+    private String tableName = "";
+    private String columnName = "";
+    private String columnLabel = "";
+    private String columnServiceName = "";
+
+    private int columnType = 0;
+    private String columnTypeName = "";
+
+    private int nullable = 0;
+    private int columnDisplaySize = 0;
+    private int precision = 0;
+    private int scale = 0;
+
+    private boolean isAutoIncrement = false;
+    private boolean isCaseSensitive = false;
+    private boolean isSearchable = true;
+    private boolean isCurrency = false;
+    private boolean isSigned = false;
+    private boolean isReadOnly = true;
+    private boolean isWritable = false;
+    private boolean isDefinitelyWritable = false;
+
+    public String getCatalogName() {
+        return catalogName;
+    }
+    public void setCatalogName(String catalogName) {
+        this.catalogName = catalogName;
+    }
+    public String getSchemaName() {
+        return schemaName;
+    }
+    public void setSchemaName(String schemaName) {
+        this.schemaName = schemaName;
+    }
+    public String getTableName() {
+        return tableName;
+    }
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
+    public String getColumnName() {
+        return columnName;
+    }
+    public void setColumnName(String columnName) {
+        this.columnName = columnName;
+    }
+    public String getColumnLabel() {
+        return columnLabel;
+    }
+    public void setColumnLabel(String columnLabel) {
+        this.columnLabel = columnLabel;
+    }
+    public String getColumnServiceName() {
+        return columnServiceName;
+    }
+    public void setColumnServiceName(String columnServiceName) {
+        this.columnServiceName = columnServiceName;
+    }
+    public int getColumnType() {
+        return columnType;
+    }
+    public void setColumnType(int columnType) {
+        this.columnType = columnType;
+    }
+    public String getColumnTypeName() {
+        return columnTypeName;
+    }
+    public void setColumnTypeName(String columnTypeName) {
+        this.columnTypeName = columnTypeName;
+    }
+    public int getNullable() {
+        return nullable;
+    }
+    public void setNullable(int nullable) {
+        this.nullable = nullable;
+    }
+    public int getColumnDisplaySize() {
+        return columnDisplaySize;
+    }
+    public void setColumnDisplaySize(int columnDisplaySize) {
+        this.columnDisplaySize = columnDisplaySize;
+    }
+    public int getPrecision() {
+        return precision;
+    }
+    public void setPrecision(int precision) {
+        this.precision = precision;
+    }
+    public int getScale() {
+        return scale;
+    }
+    public void setScale(int scale) {
+        this.scale = scale;
+    }
+    public boolean isAutoIncrement() {
+        return isAutoIncrement;
+    }
+    public void setAutoIncrement(boolean isAutoIncrement) {
+        this.isAutoIncrement = isAutoIncrement;
+    }
+    public boolean isCaseSensitive() {
+        return isCaseSensitive;
+    }
+    public void setCaseSensitive(boolean isCaseSensitive) {
+        this.isCaseSensitive = isCaseSensitive;
+    }
+    public boolean isSearchable() {
+        return isSearchable;
+    }
+    public void setSearchable(boolean isSearchable) {
+        this.isSearchable = isSearchable;
+    }
+    public boolean isCurrency() {
+        return isCurrency;
+    }
+    public void setCurrency(boolean isCurrency) {
+        this.isCurrency = isCurrency;
+    }
+    public boolean isSigned() {
+        return isSigned;
+    }
+    public void setSigned(boolean isSigned) {
+        this.isSigned = isSigned;
+    }
+    public boolean isReadOnly() {
+        return isReadOnly;
+    }
+    public void setReadOnly(boolean isReadOnly) {
+        this.isReadOnly = isReadOnly;
+    }
+    public boolean isWritable() {
+        return isWritable;
+    }
+    public void setWritable(boolean isWritable) {
+        this.isWritable = isWritable;
+    }
+    public boolean isDefinitelyWritable() {
+        return isDefinitelyWritable;
+    }
+    public void setDefinitelyWritable(boolean isDefinitelyWritable) {
+        this.isDefinitelyWritable = isDefinitelyWritable;
+    }
+}
diff --git a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
similarity index 76%
rename from connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java
rename to connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
index 5f4f50bd1d5c..7e11eec7bc4b 100644
--- a/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
@@ -19,24 +19,16 @@
  *
  *************************************************************/
 
-package com.sun.star.sdbcx.comp.postgresql;
+package org.apache.openoffice.comp.sdbc.dbtools.util;
 
 import java.util.ArrayList;
 
-import org.apache.openoffice.comp.sdbc.dbtools.util.ORowSetValue;
-import org.apache.openoffice.comp.sdbc.dbtools.util.StandardSQLState;
+import org.apache.openoffice.comp.sdbc.dbtools.comphelper.PropertySet;
 
-import com.sun.star.beans.PropertyVetoException;
-import com.sun.star.beans.UnknownPropertyException;
-import com.sun.star.beans.XPropertyChangeListener;
 import com.sun.star.beans.XPropertySet;
-import com.sun.star.beans.XPropertySetInfo;
-import com.sun.star.beans.XVetoableChangeListener;
 import com.sun.star.container.XNameAccess;
 import com.sun.star.io.XInputStream;
 import com.sun.star.lang.IllegalArgumentException;
-import com.sun.star.lang.WrappedTargetException;
-import com.sun.star.lib.uno.helper.ComponentBase;
 import com.sun.star.sdbc.SQLException;
 import com.sun.star.sdbc.XArray;
 import com.sun.star.sdbc.XBlob;
@@ -49,44 +41,30 @@ import com.sun.star.sdbc.XResultSetMetaData;
 import com.sun.star.sdbc.XResultSetMetaDataSupplier;
 import com.sun.star.sdbc.XRow;
 import com.sun.star.sdbcx.CompareBookmark;
-import com.sun.star.sdbcx.XColumnsSupplier;
 import com.sun.star.sdbcx.XRowLocate;
 import com.sun.star.uno.AnyConverter;
-import com.sun.star.uno.UnoRuntime;
 import com.sun.star.util.Date;
 import com.sun.star.util.DateTime;
 import com.sun.star.util.Time;
 
-public class DatabaseMetaDataResultSet extends ComponentBase
-        implements XResultSet, XCloseable, XColumnsSupplier, XRowLocate, XPropertySet, XColumnLocate, XRow, XResultSetMetaDataSupplier {
+public class CustomResultSet extends PropertySet
+        implements XResultSet, XCloseable, XRowLocate, XPropertySet, XColumnLocate, XRow, XResultSetMetaDataSupplier {
 
-    private XCloseable implCloseable;
-    private XResultSetMetaDataSupplier implResultSetMetaDataSupplier;
-    private XColumnLocate implColumnLocate;
-    private XPropertySet implPropertySet;
-    private XColumnsSupplier implColumnSupplier;
+    private XResultSetMetaData resultSetMetaData;
     private ArrayList<ORowSetValue[]> rows;
     /// 0-based:
     private int currentRow = -1;
     /// 1-based:
     private int currentColumn;
 
-    public DatabaseMetaDataResultSet(XResultSet impl, ArrayList<ORowSetValue[]> rows) {
-        implCloseable = UnoRuntime.queryInterface(XCloseable.class, impl);
-        implPropertySet = UnoRuntime.queryInterface(XPropertySet.class, impl);
-        implColumnSupplier = UnoRuntime.queryInterface(XColumnsSupplier.class, impl);
-        implColumnLocate = UnoRuntime.queryInterface(XColumnLocate.class, impl);
-        implResultSetMetaDataSupplier = UnoRuntime.queryInterface(XResultSetMetaDataSupplier.class, impl);
+    public CustomResultSet(XResultSetMetaData resultSetMetaData, ArrayList<ORowSetValue[]> rows) {
+        this.resultSetMetaData = resultSetMetaData;
         this.rows = rows;
     }
 
     // XComponent:
     @Override
     protected void postDisposing() {
-        try {
-            implCloseable.close();
-        } catch (SQLException sqlException) {
-        }
     }
 
     // XCloseable:
@@ -232,7 +210,7 @@ public class DatabaseMetaDataResultSet extends ComponentBase
 
     public synchronized XResultSetMetaData getMetaData() throws SQLException {
         checkDisposed();
-        return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
+        return resultSetMetaData;
     }
 
     // XRow:
@@ -353,47 +331,24 @@ public class DatabaseMetaDataResultSet extends ComponentBase
 
     // XColumnLocate:
 
-    public synchronized int findColumn(String arg0) throws SQLException {
-        checkDisposed();
-        return implColumnLocate.findColumn(arg0);
-    }
-
-    // XPropertySet:
-
-    public synchronized void addPropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
-        implPropertySet.addPropertyChangeListener(arg0, arg1);
-    }
-
-    public synchronized void addVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
-        implPropertySet.addVetoableChangeListener(arg0, arg1);
-    }
-
-    public synchronized XPropertySetInfo getPropertySetInfo() {
+    public synchronized int findColumn(String name) throws SQLException {
         checkDisposed();
-        return implPropertySet.getPropertySetInfo();
-    }
-
-    public synchronized Object getPropertyValue(String arg0) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
-        return implPropertySet.getPropertyValue(arg0);
-    }
-
-    public synchronized void removePropertyChangeListener(String arg0, XPropertyChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
-        implPropertySet.removePropertyChangeListener(arg0, arg1);
-    }
-
-    public synchronized void removeVetoableChangeListener(String arg0, XVetoableChangeListener arg1) throws UnknownPropertyException, WrappedTargetException {
-        checkDisposed();
-        implPropertySet.removeVetoableChangeListener(arg0, arg1);
-    }
-
-    public synchronized void setPropertyValue(String arg0, Object arg1)
-            throws UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException {
-        checkDisposed();
-        implPropertySet.setPropertyValue(arg0, arg1);
+        for (int i = 1; i <= resultSetMetaData.getColumnCount(); i++) {
+            boolean isCaseSensitive = resultSetMetaData.isCaseSensitive(i);
+            String columnName = resultSetMetaData.getColumnName(i);
+            boolean matched;
+            if (isCaseSensitive) {
+                matched = columnName.equals(name);
+            } else {
+                matched = columnName.equalsIgnoreCase(name);
+            }
+            if (matched) {
+                return i;
+            }
+        }
+        String error = SharedResources.getInstance().getResourceStringWithSubstitution(
+                Resources.STR_UNKNOWN_COLUMN_NAME, "$columnname$", name);
+        throw new SQLException(error, this, StandardSQLState.SQL_COLUMN_NOT_FOUND.text(), 0, null);
     }
 
     // XRowLocate:
@@ -471,11 +426,4 @@ public class DatabaseMetaDataResultSet extends ComponentBase
         }
         return moved;
     }
-
-    // XColumnSupplier:
-
-    public synchronized XNameAccess getColumns() {
-        checkDisposed();
-        return implColumnSupplier.getColumns();
-    }
 }
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
new file mode 100644
index 000000000000..7a46e9396a75
--- /dev/null
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
@@ -0,0 +1,225 @@
+/**************************************************************
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ *************************************************************/
+package org.apache.openoffice.comp.sdbc.dbtools.util;
+
+import com.sun.star.lib.uno.helper.WeakBase;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XResultSetMetaData;
+
+public class CustomResultSetMetaData extends WeakBase implements XResultSetMetaData {
+    private CustomColumn[] columns;
+
+    public CustomResultSetMetaData(CustomColumn[] columns) {
+        this.columns = columns;
+    }
+
+    private CustomColumn getColumn(int i) {
+        if (i < 1 || columns.length < i) {
+            return null;
+        }
+        return columns[i-1];
+    }
+
+    @Override
+    public String getCatalogName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getCatalogName();
+        }
+        return "";
+    }
+
+    @Override
+    public int getColumnCount() throws SQLException {
+        return columns.length;
+    }
+
+    @Override
+    public int getColumnDisplaySize(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnDisplaySize();
+        }
+        return 0;
+    }
+
+    @Override
+    public String getColumnLabel(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnLabel();
+        }
+        return getColumnName(column);
+    }
+
+    @Override
+    public String getColumnName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnName();
+        }
+        return "";
+    }
+
+    @Override
+    public String getColumnServiceName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnServiceName();
+        }
+        return "";
+    }
+
+    @Override
+    public int getColumnType(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnType();
+        }
+        return 1;
+    }
+
+    @Override
+    public String getColumnTypeName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getColumnTypeName();
+        }
+        return "";
+    }
+
+    @Override
+    public int getPrecision(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getPrecision();
+        }
+        return 0;
+    }
+
+    @Override
+    public int getScale(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getScale();
+        }
+        return 0;
+    }
+
+    @Override
+    public String getSchemaName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getSchemaName();
+        }
+        return "";
+    }
+
+    @Override
+    public String getTableName(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getTableName();
+        }
+        return "";
+    }
+
+    @Override
+    public boolean isAutoIncrement(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isAutoIncrement();
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isCaseSensitive(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isCaseSensitive();
+        }
+        return true;
+    }
+
+    @Override
+    public boolean isCurrency(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isCurrency();
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isDefinitelyWritable(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isDefinitelyWritable();
+        }
+        return false;
+    }
+
+    @Override
+    public int isNullable(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.getNullable();
+        }
+        return 0;
+    }
+
+    @Override
+    public boolean isReadOnly(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isReadOnly();
+        }
+        return true;
+    }
+
+    @Override
+    public boolean isSearchable(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isSearchable();
+        }
+        return true;
+    }
+
+    @Override
+    public boolean isSigned(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isSigned();
+        }
+        return false;
+    }
+
+    @Override
+    public boolean isWritable(int column) throws SQLException {
+        CustomColumn customColumn = getColumn(column);
+        if (customColumn != null) {
+            return customColumn.isWritable();
+        }
+        return false;
+    }
+}
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
index 66bcdce43d18..21ec0257b3c5 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
@@ -19,10 +19,13 @@
  *
  *************************************************************/
 
-package com.sun.star.sdbcx.comp.postgresql.util;
+package org.apache.openoffice.comp.sdbc.dbtools.util;
 
 import java.util.ArrayList;
 
+import org.apache.openoffice.comp.sdbc.dbtools.util.ORowSetValue;
+import org.apache.openoffice.comp.sdbc.dbtools.util.StandardSQLState;
+
 import com.sun.star.beans.PropertyVetoException;
 import com.sun.star.beans.UnknownPropertyException;
 import com.sun.star.beans.XPropertyChangeListener;
@@ -48,7 +51,6 @@ import com.sun.star.sdbc.XRow;
 import com.sun.star.sdbcx.CompareBookmark;
 import com.sun.star.sdbcx.XColumnsSupplier;
 import com.sun.star.sdbcx.XRowLocate;
-import com.sun.star.sdbcx.comp.postgresql.PostgresqlResultSetMetaData;
 import com.sun.star.uno.AnyConverter;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.util.Date;
@@ -230,7 +232,7 @@ public class DatabaseMetaDataResultSet extends ComponentBase
 
     public synchronized XResultSetMetaData getMetaData() throws SQLException {
         checkDisposed();
-        return new PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
+        return implResultSetMetaDataSupplier.getMetaData();
     }
 
     // XRow:
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
index a64ff5f890a4..50195e1255d2 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
@@ -36,6 +36,8 @@ import com.sun.star.container.ElementExistException;
 import com.sun.star.container.XChild;
 import com.sun.star.container.XIndexAccess;
 import com.sun.star.container.XNameAccess;
+import com.sun.star.io.IOException;
+import com.sun.star.io.XInputStream;
 import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.lang.IndexOutOfBoundsException;
 import com.sun.star.lang.WrappedTargetException;
@@ -47,10 +49,12 @@ import com.sun.star.sdbc.SQLException;
 import com.sun.star.sdbc.XConnection;
 import com.sun.star.sdbc.XDataSource;
 import com.sun.star.sdbc.XDatabaseMetaData;
+import com.sun.star.sdbc.XParameters;
 import com.sun.star.sdbc.XResultSet;
 import com.sun.star.sdbc.XResultSetMetaData;
 import com.sun.star.sdbc.XResultSetMetaDataSupplier;
 import com.sun.star.sdbc.XRow;
+import com.sun.star.sdbc.XRowUpdate;
 import com.sun.star.sdbc.XStatement;
 import com.sun.star.sdbcx.KeyType;
 import com.sun.star.sdbcx.XAppend;
@@ -58,18 +62,18 @@ import com.sun.star.sdbcx.XColumnsSupplier;
 import com.sun.star.sdbcx.XKeysSupplier;
 import com.sun.star.uno.Any;
 import com.sun.star.uno.AnyConverter;
+import com.sun.star.uno.Type;
+import com.sun.star.uno.TypeClass;
 import com.sun.star.uno.UnoRuntime;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
 
 public class DbTools {
     private static class NameComponentSupport {
         boolean useCatalogs;
         boolean useSchemas;
 
-        NameComponentSupport() {
-            useCatalogs = true;
-            useSchemas = true;
-        }
-
         NameComponentSupport(boolean useCatalogs, boolean useSchemas) {
             this.useCatalogs = useCatalogs;
             this.useSchemas = useSchemas;
@@ -760,4 +764,174 @@ public class DbTools {
             }
         }
     }
+
+    public static boolean updateObject(XRowUpdate updatedObject, int columnIndex, Object value) throws SQLException {
+        try {
+            boolean successfullyReRouted = true;
+            Type type = AnyConverter.getType(value);
+            switch (type.getTypeClass().getValue()) {
+            case TypeClass.VOID_value:
+                updatedObject.updateNull(columnIndex);
+                break;
+            case TypeClass.STRING_value:
+                updatedObject.updateString(columnIndex, AnyConverter.toString(value));
+                break;
+            case TypeClass.BOOLEAN_value:
+                updatedObject.updateBoolean(columnIndex, AnyConverter.toBoolean(value));
+                break;
+            case TypeClass.BYTE_value:
+                updatedObject.updateByte(columnIndex, AnyConverter.toByte(value));
+                break;
+            case TypeClass.UNSIGNED_SHORT_value:
+                updatedObject.updateShort(columnIndex, AnyConverter.toUnsignedShort(value));
+                break;
+            case TypeClass.SHORT_value:
+                updatedObject.updateShort(columnIndex, AnyConverter.toShort(value));
+                break;
+            case TypeClass.CHAR_value:
+                updatedObject.updateString(columnIndex, Character.toString(AnyConverter.toChar(value)));
+                break;
+            case TypeClass.UNSIGNED_LONG_value:
+                updatedObject.updateInt(columnIndex, AnyConverter.toUnsignedInt(value));
+                break;
+            case TypeClass.LONG_value:
+                updatedObject.updateInt(columnIndex, AnyConverter.toInt(value));
+                break;
+            case TypeClass.UNSIGNED_HYPER_value:
+                updatedObject.updateLong(columnIndex, AnyConverter.toUnsignedLong(value));
+                break;
+            case TypeClass.HYPER_value:
+                updatedObject.updateLong(columnIndex, AnyConverter.toLong(value));
+                break;
+            case TypeClass.FLOAT_value:
+                updatedObject.updateFloat(columnIndex, AnyConverter.toFloat(value));
+                break;
+            case TypeClass.DOUBLE_value:
+                updatedObject.updateDouble(columnIndex, AnyConverter.toDouble(value));
+                break;
+            case TypeClass.SEQUENCE_value:
+                if (AnyConverter.isArray(value)) {
+                    Object array = AnyConverter.toArray(value);
+                    if (array instanceof byte[]) {
+                        updatedObject.updateBytes(columnIndex, (byte[]) array);
+                    } else {
+                        successfullyReRouted = false;
+                    }
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            case TypeClass.STRUCT_value:
+                Object object = AnyConverter.toObject(Object.class, value);
+                if (object instanceof Date) {
+                    updatedObject.updateDate(columnIndex, (Date)object);
+                } else if (object instanceof Time) {
+                    updatedObject.updateTime(columnIndex, (Time)object);
+                } else if (object instanceof DateTime) {
+                    updatedObject.updateTimestamp(columnIndex, (DateTime)object);
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            case TypeClass.INTERFACE_value:
+                XInputStream inputStream = UnoRuntime.queryInterface(XInputStream.class, AnyConverter.toObject(Object.class, value));
+                if (inputStream != null) {
+                    updatedObject.updateBinaryStream(columnIndex, inputStream, inputStream.available());
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            default:
+                successfullyReRouted = false;
+            }
+            return successfullyReRouted;
+        } catch (IllegalArgumentException | IOException exception) {
+            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+        }
+    }
+
+    public static boolean setObject(XParameters parameters, int index, Object any) throws SQLException {
+        Type type = AnyConverter.getType(any);
+        try {
+            boolean successfullyReRouted = true;
+            switch (type.getTypeClass().getValue()) {
+            case TypeClass.HYPER_value:
+                parameters.setLong(index, AnyConverter.toLong(any));
+                break;
+            case TypeClass.UNSIGNED_HYPER_value:
+                parameters.setLong(index, AnyConverter.toUnsignedLong(any));
+                break;
+            case TypeClass.VOID_value:
+                parameters.setNull(index, DataType.VARCHAR);
+                break;
+            case TypeClass.STRING_value:
+                parameters.setString(index, AnyConverter.toString(any));
+                break;
+            case TypeClass.BOOLEAN_value:
+                parameters.setBoolean(index, AnyConverter.toBoolean(any));
+                break;
+            case TypeClass.BYTE_value:
+                parameters.setByte(index, AnyConverter.toByte(any));
+                break;
+            case TypeClass.SHORT_value:
+                parameters.setShort(index, AnyConverter.toShort(any));
+                break;
+            case TypeClass.UNSIGNED_SHORT_value:
+                parameters.setShort(index, AnyConverter.toUnsignedShort(any));
+                break;
+            case TypeClass.CHAR_value:
+                parameters.setString(index, Character.toString(AnyConverter.toChar(any)));
+                break;
+            case TypeClass.LONG_value:
+                parameters.setInt(index, AnyConverter.toInt(any));
+                break;
+            case TypeClass.UNSIGNED_LONG_value:
+                parameters.setInt(index, AnyConverter.toUnsignedInt(any));
+                break;
+            case TypeClass.FLOAT_value:
+                parameters.setFloat(index, AnyConverter.toFloat(any));
+                break;
+            case TypeClass.DOUBLE_value:
+                parameters.setDouble(index, AnyConverter.toDouble(any));
+                break;
+            case TypeClass.SEQUENCE_value:
+                if (AnyConverter.isArray(any)) {
+                    Object array = AnyConverter.toArray(any);
+                    if (array instanceof byte[]) {
+                        parameters.setBytes(index, (byte[])array);
+                    } else {
+                        successfullyReRouted = false;
+                    }
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            case TypeClass.STRUCT_value:
+                Object object = AnyConverter.toObject(Object.class, any);
+                if (object instanceof Date) {
+                    parameters.setDate(index, (Date)object);
+                } else if (object instanceof Time) {
+                    parameters.setTime(index, (Time)object);
+                } else if (object instanceof DateTime) {
+                    parameters.setTimestamp(index, (DateTime)object);
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            case TypeClass.INTERFACE_value:
+                XInputStream inputStream = UnoRuntime.queryInterface(XInputStream.class, AnyConverter.toObject(Object.class, any));
+                if (inputStream != null) {
+                    parameters.setBinaryStream(index, inputStream, inputStream.available());
+                } else {
+                    successfullyReRouted = false;
+                }
+                break;
+            default:
+                successfullyReRouted = false;
+            }
+            return successfullyReRouted;
+        } catch (IllegalArgumentException | IOException exception) {
+            throw new SQLException("Error", Any.VOID, StandardSQLState.SQL_GENERAL_ERROR.text(), 0, exception);
+        }
+    }
 }
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
index b4402bdc5e6c..0ec867ef85be 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingException;
 
 import com.sun.star.io.IOException;
 import com.sun.star.io.XInputStream;
+import com.sun.star.lang.IllegalArgumentException;
 import com.sun.star.sdbc.DataType;
 import com.sun.star.sdbc.SQLException;
 import com.sun.star.sdbc.XBlob;
@@ -33,6 +34,7 @@ import com.sun.star.sdbc.XClob;
 import com.sun.star.uno.Any;
 import com.sun.star.uno.AnyConverter;
 import com.sun.star.uno.Type;
+import com.sun.star.uno.TypeClass;
 import com.sun.star.uno.UnoRuntime;
 import com.sun.star.util.Date;
 import com.sun.star.util.DateTime;
@@ -292,9 +294,181 @@ public class ORowSetValue {
         }
     }
 
-    public Any getAny() {
-        Any any = (Any)value;
-        return new Any(any.getType(), any.getObject());
+    public void fill(Object any) {
+        final Type type = AnyConverter.getType(any);
+
+        switch (type.getTypeClass().getValue()) {
+        case TypeClass.VOID_value:
+            setNull();
+            break;
+        case TypeClass.BOOLEAN_value: {
+            boolean value = false;
+            try {
+                value = AnyConverter.toBoolean(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setBoolean(value);
+            break;
+        }
+        case TypeClass.CHAR_value: {
+            char value = 0;
+            try {
+                value = AnyConverter.toChar(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setString(Character.toString(value));
+            break;
+        }
+        case TypeClass.STRING_value: {
+            String value = "";
+            try {
+                value = AnyConverter.toString(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setString(value);
+            break;
+        }
+        case TypeClass.FLOAT_value: {
+            float value = 0.0f;
+            try {
+                value = AnyConverter.toFloat(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setFloat(value);
+            break;
+        }
+        case TypeClass.DOUBLE_value: {
+            double value = 0.0;
+            try {
+                value = AnyConverter.toDouble(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setDouble(value);
+            break;
+        }
+        case TypeClass.BYTE_value: {
+            byte value = 0;
+            try {
+                value = AnyConverter.toByte(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt8(value);
+            break;
+        }
+        case TypeClass.SHORT_value: {
+            short value = 0;
+            try {
+                AnyConverter.toShort(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt16(value);
+            break;
+        }
+        case TypeClass.UNSIGNED_SHORT_value: {
+            short value = 0;
+            try {
+                AnyConverter.toUnsignedShort(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt16(value);
+            setSigned(false);
+            break;
+        }
+        case TypeClass.LONG_value: {
+            int value = 0;
+            try {
+                value = AnyConverter.toInt(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt32(value);
+            break;
+        }
+        case TypeClass.UNSIGNED_LONG_value: {
+            int value = 0;
+            try {
+                value = AnyConverter.toUnsignedInt(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt32(value);
+            setSigned(false);
+            break;
+        }
+        case TypeClass.HYPER_value: {
+            long value = 0;
+            try {
+                value = AnyConverter.toLong(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setLong(value);
+            break;
+        }
+        case TypeClass.UNSIGNED_HYPER_value: {
+            long value = 0;
+            try {
+                value = AnyConverter.toUnsignedLong(any);
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setLong(value);
+            setSigned(false);
+            break;
+        }
+        case TypeClass.ENUM_value: {
+            // FIXME: is this how an enum is unboxed from Any?
+            int value = 0;
+            try {
+                Object object = AnyConverter.toObject(type, any);
+                if (object instanceof com.sun.star.uno.Enum) {
+                    value = ((com.sun.star.uno.Enum)object).getValue();
+                }
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setInt32(value);
+            break;
+        }
+        case TypeClass.SEQUENCE_value: {
+            byte[] value = new byte[0];
+            try {
+                Object array = AnyConverter.toArray(value);
+                if (array instanceof byte[]) {
+                    value = (byte[]) array;
+                }
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            setSequence(value);
+            break;
+        }
+        case TypeClass.STRUCT_value:
+        case TypeClass.INTERFACE_value: {
+            try {
+                Object object = AnyConverter.toObject(Object.class, any);
+                if (object instanceof Date) {
+                    setDate((Date)object);
+                } else if (object instanceof Time) {
+                    setTime((Time)object);
+                } else if (object instanceof DateTime) {
+                    setDateTime((DateTime)object);
+                } else {
+                    XClob clob = UnoRuntime.queryInterface(XClob.class, object);
+                    if (clob != null) {
+                        setAny(clob);
+                    } else {
+                        XBlob blob = UnoRuntime.queryInterface(XBlob.class, object);
+                        if (blob != null) {
+                            setAny(blob);
+                        }
+                    }
+                }
+            } catch (IllegalArgumentException illegalArgumentException) {
+            }
+            break;
+        }
+        default:
+            // unknown type
+        }
+    }
+
+    public Object getAny() {
+        return value;
     }
 
     public boolean getBoolean() {
@@ -996,9 +1170,9 @@ public class ORowSetValue {
         return aValue;
     }
 
-    public void setAny(Any value) {
+    public void setAny(Object value) {
         flags &= ~FLAG_NULL;
-        this.value = new Any(value.getType(), value.getObject());
+        this.value = value;
         typeKind = DataType.OBJECT;
     }
 
@@ -1076,7 +1250,7 @@ public class ORowSetValue {
     }
 
     public Object makeAny() {
-        Object rValue = new Any(Type.VOID, null);
+        Object rValue = Any.VOID;
         if(isBound() && !isNull()) {
             switch (getTypeKind()) {
             case DataType.CHAR:
diff --git a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
index 97b736782ce3..8fab182757c2 100644
--- a/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
+++ b/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
@@ -19,10 +19,13 @@
  *
  *************************************************************/
 
-package com.sun.star.sdbcx.comp.postgresql.util;
+package org.apache.openoffice.comp.sdbc.dbtools.util;
 
 public class Resources {
     public static final int STR_COMMON_BASE = 1200;
+    // = resource ids for log messages
+    public static final int STR_LOG_MESSAGE_BASE = 10000;
+    public static final int STR_JDBC_LOG_MESSAGE_BASE = STR_LOG_MESSAGE_BASE + 500;
 
     public static final int STR_STRING_LENGTH_EXCEEDED = (STR_COMMON_BASE + 1);
     public static final int STR_CANNOT_CONVERT_STRING = (STR_COMMON_BASE + 2);
@@ -63,4 +66,60 @@ public class Resources {
     public static final int STR_WRONG_PARAM_INDEX = (STR_COMMON_BASE + 37);
     public static final int STR_NO_CONNECTION_GIVEN = (STR_COMMON_BASE + 38);
 
+    public static final int STR_LOG_DRIVER_CONNECTING_URL      = ( STR_JDBC_LOG_MESSAGE_BASE +  1 );
+    public static final int STR_LOG_DRIVER_SUCCESS             = ( STR_JDBC_LOG_MESSAGE_BASE +  2 );
+    public static final int STR_LOG_CREATE_STATEMENT           = ( STR_JDBC_LOG_MESSAGE_BASE +  3 );
+    public static final int STR_LOG_CREATED_STATEMENT_ID       = ( STR_JDBC_LOG_MESSAGE_BASE +  4 );
+    public static final int STR_LOG_PREPARE_STATEMENT          = ( STR_JDBC_LOG_MESSAGE_BASE +  5 );
+    public static final int STR_LOG_PREPARED_STATEMENT_ID      = ( STR_JDBC_LOG_MESSAGE_BASE +  6 );
+    public static final int STR_LOG_PREPARE_CALL               = ( STR_JDBC_LOG_MESSAGE_BASE +  7 );
+    public static final int STR_LOG_PREPARED_CALL_ID           = ( STR_JDBC_LOG_MESSAGE_BASE +  8 );
+    public static final int STR_LOG_NATIVE_SQL                 = ( STR_JDBC_LOG_MESSAGE_BASE +  9 );
+    public static final int STR_LOG_LOADING_DRIVER             = ( STR_JDBC_LOG_MESSAGE_BASE + 10 );
+    public static final int STR_LOG_NO_DRIVER_CLASS            = ( STR_JDBC_LOG_MESSAGE_BASE + 11 );
+    public static final int STR_LOG_CONN_SUCCESS               = ( STR_JDBC_LOG_MESSAGE_BASE + 12 );
+    public static final int STR_LOG_NO_SYSTEM_CONNECTION       = ( STR_JDBC_LOG_MESSAGE_BASE + 13 );
+    public static final int STR_LOG_GOT_JDBC_CONNECTION        = ( STR_JDBC_LOG_MESSAGE_BASE + 14 );
+    public static final int STR_LOG_SHUTDOWN_CONNECTION        = ( STR_JDBC_LOG_MESSAGE_BASE + 15 );
+    public static final int STR_LOG_GENERATED_VALUES            =( STR_JDBC_LOG_MESSAGE_BASE + 16 );
+    public static final int STR_LOG_GENERATED_VALUES_FALLBACK  = ( STR_JDBC_LOG_MESSAGE_BASE + 17 );
+    public static final int STR_LOG_EXECUTE_STATEMENT          = ( STR_JDBC_LOG_MESSAGE_BASE + 18 );
+    public static final int STR_LOG_EXECUTE_QUERY              = ( STR_JDBC_LOG_MESSAGE_BASE + 19 );
+    public static final int STR_LOG_CLOSING_STATEMENT          = ( STR_JDBC_LOG_MESSAGE_BASE + 20 );
+    public static final int STR_LOG_EXECUTE_UPDATE             = ( STR_JDBC_LOG_MESSAGE_BASE + 21 );
+    public static final int STR_LOG_UPDATE_COUNT               = ( STR_JDBC_LOG_MESSAGE_BASE + 22 );
+    public static final int STR_LOG_RESULT_SET_CONCURRENCY     = ( STR_JDBC_LOG_MESSAGE_BASE + 23 );
+    public static final int STR_LOG_RESULT_SET_TYPE            = ( STR_JDBC_LOG_MESSAGE_BASE + 24 );
+    public static final int STR_LOG_FETCH_DIRECTION            = ( STR_JDBC_LOG_MESSAGE_BASE + 25 );
+    public static final int STR_LOG_FETCH_SIZE                 = ( STR_JDBC_LOG_MESSAGE_BASE + 26 );
+    public static final int STR_LOG_SET_ESCAPE_PROCESSING      = ( STR_JDBC_LOG_MESSAGE_BASE + 27 );
+    public static final int STR_LOG_EXECUTING_PREPARED         = ( STR_JDBC_LOG_MESSAGE_BASE + 28 );
+    public static final int STR_LOG_EXECUTING_PREPARED_UPDATE  = ( STR_JDBC_LOG_MESSAGE_BASE + 29 );
+    public static final int STR_LOG_EXECUTING_PREPARED_QUERY   = ( STR_JDBC_LOG_MESSAGE_BASE + 30 );
+    public static final int STR_LOG_STRING_PARAMETER           = ( STR_JDBC_LOG_MESSAGE_BASE + 31 );
+    public static final int STR_LOG_BOOLEAN_PARAMETER          = ( STR_JDBC_LOG_MESSAGE_BASE + 32 );
+    public static final int STR_LOG_BYTE_PARAMETER             = ( STR_JDBC_LOG_MESSAGE_BASE + 33 );
+    public static final int STR_LOG_DATE_PARAMETER             = ( STR_JDBC_LOG_MESSAGE_BASE + 34 );
+    public static final int STR_LOG_TIME_PARAMETER             = ( STR_JDBC_LOG_MESSAGE_BASE + 35 );
+    public static final int STR_LOG_TIMESTAMP_PARAMETER        = ( STR_JDBC_LOG_MESSAGE_BASE + 36 );
+    public static final int STR_LOG_DOUBLE_PARAMETER           = ( STR_JDBC_LOG_MESSAGE_BASE + 37 );
+    public static final int STR_LOG_FLOAT_PARAMETER            = ( STR_JDBC_LOG_MESSAGE_BASE + 38 );
+    public static final int STR_LOG_INT_PARAMETER              = ( STR_JDBC_LOG_MESSAGE_BASE + 39 );
+    public static final int STR_LOG_LONG_PARAMETER             = ( STR_JDBC_LOG_MESSAGE_BASE + 40 );
+    public static final int STR_LOG_NULL_PARAMETER             = ( STR_JDBC_LOG_MESSAGE_BASE + 41 );
+    public static final int STR_LOG_OBJECT_NULL_PARAMETER      = ( STR_JDBC_LOG_MESSAGE_BASE + 42 );
+    public static final int STR_LOG_SHORT_PARAMETER            = ( STR_JDBC_LOG_MESSAGE_BASE + 43 );
+    public static final int STR_LOG_BYTES_PARAMETER            = ( STR_JDBC_LOG_MESSAGE_BASE + 44 );
+    public static final int STR_LOG_CHARSTREAM_PARAMETER       = ( STR_JDBC_LOG_MESSAGE_BASE + 45 );
+    public static final int STR_LOG_BINARYSTREAM_PARAMETER     = ( STR_JDBC_LOG_MESSAGE_BASE + 46 );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list