Author: damjan
Date: Wed Nov  8 04:17:25 2017
New Revision: 1814552

URL: http://svn.apache.org/viewvc?rev=1814552&view=rev
Log:
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


Added:
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
   (with props)
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
      - copied, changed from r1814551, 
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/build.xml   (with props)
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/jdbc.component   (with 
props)
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/jdbc.xml   (with props)
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/makefile.mk
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/sdbc_jdbc.xcu   (with 
props)
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/
    openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/BoundedInputStream.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ClassMap.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ConnectionLog.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ContextClassLoaderScope.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JDBCDriver.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLArray.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLBlob.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLCallableStatement.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLClob.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLConnection.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLDatabaseMetaData.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLPreparedStatement.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLRef.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSet.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLResultSetMetaData.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLStatement.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/JavaSQLStatementBase.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/ReaderInputStream.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_jdbc/src/com/sun/star/comp/sdbc/Tools.java
   (with props)
    
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDatabaseMetaDataResultSet.java
   (with props)
Removed:
    
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java
Modified:
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
    
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
    
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlDatabaseMetadata.java
    
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/PostgresqlViews.java
    openoffice/trunk/main/connectivity/prj/build.lst
    openoffice/trunk/main/connectivity/prj/d.lst
    openoffice/trunk/main/offapi/UnoApi_offapi.mk
    openoffice/trunk/main/postprocess/packregistry/makefile.mk
    openoffice/trunk/main/scp2/source/ooo/file_library_ooo.scp
    openoffice/trunk/main/scp2/source/ooo/file_ooo.scp
    openoffice/trunk/main/scp2/source/ooo/module_hidden_ooo.scp

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
 Wed Nov  8 04:17:25 2017
@@ -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;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/EventLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java?rev=1814552&r1=1814551&r2=1814552&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/PropertySetAdapter.java
 Wed Nov  8 04:17:25 2017
@@ -65,11 +65,11 @@ public class PropertySetAdapter implemen
     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 implemen
         return propertyData;
     }
     
-    private Object getPropertyValue(PropertyData propertyData) {
+    private Object getPropertyValue(PropertyData propertyData) throws 
WrappedTargetException {
         Object ret;
         synchronized (lock) {
             ret = propertyData.getter.getValue();

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
 Wed Nov  8 04:17:25 2017
@@ -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;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/comphelper/ResourceBasedEventLogger.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
 Wed Nov  8 04:17:25 2017
@@ -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;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/AutoRetrievingBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
 Wed Nov  8 04:17:25 2017
@@ -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;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomColumn.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
 Wed Nov  8 04:17:25 2017
@@ -0,0 +1,429 @@
+/**************************************************************
+ * 
+ * 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 java.util.ArrayList;
+
+import org.apache.openoffice.comp.sdbc.dbtools.comphelper.PropertySet;
+
+import com.sun.star.beans.XPropertySet;
+import com.sun.star.container.XNameAccess;
+import com.sun.star.io.XInputStream;
+import com.sun.star.lang.IllegalArgumentException;
+import com.sun.star.sdbc.SQLException;
+import com.sun.star.sdbc.XArray;
+import com.sun.star.sdbc.XBlob;
+import com.sun.star.sdbc.XClob;
+import com.sun.star.sdbc.XCloseable;
+import com.sun.star.sdbc.XColumnLocate;
+import com.sun.star.sdbc.XRef;
+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.sdbcx.CompareBookmark;
+import com.sun.star.sdbcx.XRowLocate;
+import com.sun.star.uno.AnyConverter;
+import com.sun.star.util.Date;
+import com.sun.star.util.DateTime;
+import com.sun.star.util.Time;
+
+public class CustomResultSet extends PropertySet
+        implements XResultSet, XCloseable, XRowLocate, XPropertySet, 
XColumnLocate, XRow, XResultSetMetaDataSupplier {
+
+    private XResultSetMetaData resultSetMetaData;
+    private ArrayList<ORowSetValue[]> rows;
+    /// 0-based:
+    private int currentRow = -1;
+    /// 1-based:
+    private int currentColumn;
+    
+    public CustomResultSet(XResultSetMetaData resultSetMetaData, 
ArrayList<ORowSetValue[]> rows) {
+        this.resultSetMetaData = resultSetMetaData;
+        this.rows = rows;
+    }
+    
+    // XComponent:
+    @Override
+    protected void postDisposing() {
+    }
+
+    // XCloseable:
+    
+    public void close() throws SQLException {
+        dispose();
+    }
+
+    // XResultSet:
+    
+    private ORowSetValue getField(int columnIndex) throws SQLException {
+        if (isBeforeFirst() || isAfterLast()) {
+            throw new SQLException("Row out of range");
+        }
+        ORowSetValue[] fields = rows.get(currentRow);
+        if (columnIndex < 1 || fields.length < columnIndex) {
+            throw new SQLException("Column out of range");
+        }
+        currentColumn = columnIndex;
+        return fields[columnIndex - 1];
+    }
+    
+    public synchronized boolean absolute(int position) throws SQLException {
+        checkDisposed();
+        if (position >= 0) {
+            currentRow = position;
+        } else {
+            currentRow = rows.size() + position;
+        }
+        if (currentRow <= -1) {
+            currentRow = -1;
+            return false;
+        }
+        if (currentRow >= rows.size()) {
+            currentRow = rows.size();
+            return false;
+        }
+        return true;
+    }
+
+    public synchronized void afterLast() throws SQLException {
+        checkDisposed();
+        currentRow = rows.size();
+    }
+
+    public synchronized void beforeFirst() throws SQLException {
+        checkDisposed();
+        currentRow = -1;
+    }
+
+    public synchronized boolean first() throws SQLException {
+        checkDisposed();
+        currentRow = 0;
+        return true;
+    }
+
+    public synchronized int getRow() throws SQLException {
+        checkDisposed();
+        return currentRow + 1;
+    }
+
+    public synchronized Object getStatement() throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized boolean isAfterLast() throws SQLException {
+        checkDisposed();
+        return currentRow == rows.size();
+    }
+
+    public synchronized boolean isBeforeFirst() throws SQLException {
+        checkDisposed();
+        return currentRow == -1;
+    }
+
+    public synchronized boolean isFirst() throws SQLException {
+        checkDisposed();
+        return currentRow == 0;
+    }
+
+    public synchronized boolean isLast() throws SQLException {
+        checkDisposed();
+        return currentRow == (rows.size() - 1);
+    }
+
+    public synchronized boolean last() throws SQLException {
+        checkDisposed();
+        currentRow = rows.size() - 1;
+        return true;
+    }
+
+    public synchronized boolean next() throws SQLException {
+        checkDisposed();
+        if (currentRow < rows.size()) {
+            ++currentRow;
+        }
+        return currentRow < rows.size();
+    }
+
+    public synchronized boolean previous() throws SQLException {
+        checkDisposed();
+        if (currentRow > -1) {
+            --currentRow;
+        }
+        return currentRow > -1;
+    }
+
+    public synchronized void refreshRow() throws SQLException {
+        checkDisposed();
+    }
+
+    public synchronized boolean relative(int offset) throws SQLException {
+        checkDisposed();
+        currentRow += offset;
+        if (currentRow <= -1) {
+            currentRow = -1;
+            return false;
+        }
+        if (currentRow >= rows.size()) {
+            currentRow = rows.size();
+            return false;
+        }
+        return true;
+    }
+
+    public synchronized boolean rowDeleted() throws SQLException {
+        checkDisposed();
+        return false;
+    }
+
+    public synchronized boolean rowInserted() throws SQLException {
+        checkDisposed();
+        return false;
+    }
+
+    public synchronized boolean rowUpdated() throws SQLException {
+        checkDisposed();
+        return false;
+    }
+
+    // XResultSetMetaDataSupplier:
+    
+    public synchronized XResultSetMetaData getMetaData() throws SQLException {
+        checkDisposed();
+        return resultSetMetaData;
+    }
+
+    // XRow:
+    
+    public synchronized XArray getArray(int columnIndex) throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized XInputStream getBinaryStream(int columnIndex) throws 
SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized XBlob getBlob(int columnIndex) throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized boolean getBoolean(int columnIndex) throws 
SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getBoolean();
+    }
+
+    public synchronized byte getByte(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getInt8();
+    }
+
+    public synchronized byte[] getBytes(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getSequence();
+    }
+
+    public synchronized XInputStream getCharacterStream(int columnIndex) 
throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized XClob getClob(int columnIndex) throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized Date getDate(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getDate();
+    }
+
+    public synchronized double getDouble(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getDouble();
+    }
+
+    public synchronized float getFloat(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getFloat();
+    }
+
+    public synchronized int getInt(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getInt32();
+    }
+
+    public synchronized long getLong(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getLong();
+    }
+
+    public synchronized Object getObject(int columnIndex, XNameAccess arg1) 
throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.makeAny();
+    }
+
+    public synchronized XRef getRef(int columnIndex) throws SQLException {
+        checkDisposed();
+        return null;
+    }
+
+    public synchronized short getShort(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getInt16();
+    }
+
+    public synchronized String getString(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getString();
+    }
+
+    public synchronized Time getTime(int columnIndex) throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getTime();
+    }
+
+    public synchronized DateTime getTimestamp(int columnIndex) throws 
SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(columnIndex);
+        return field.getDateTime();
+    }
+
+    public synchronized boolean wasNull() throws SQLException {
+        checkDisposed();
+        ORowSetValue field = getField(currentColumn);
+        return field.isNull();
+    }
+
+    // XColumnLocate:
+    
+    public synchronized int findColumn(String name) throws SQLException {
+        checkDisposed();
+        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:    
+
+    public synchronized int compareBookmarks(Object arg0, Object arg1) throws 
SQLException {
+        checkDisposed();
+        
+        int bookmark1, bookmark2;
+        try {
+            bookmark1 = AnyConverter.toInt(arg0);
+            bookmark2 = AnyConverter.toInt(arg1);
+        } catch (IllegalArgumentException illegalArgumentException) {
+            return CompareBookmark.NOT_COMPARABLE;
+        }
+        
+        if (bookmark1 < bookmark2) {
+            return CompareBookmark.LESS;
+        } else if (bookmark1 > bookmark2) {
+            return CompareBookmark.GREATER;
+        } else {
+            return CompareBookmark.EQUAL;
+        }
+    }
+
+    public synchronized Object getBookmark() throws SQLException {
+        checkDisposed();
+        return currentRow;
+    }
+
+    public synchronized boolean hasOrderedBookmarks() throws SQLException {
+        checkDisposed();
+        return true;
+    }
+
+    public synchronized int hashBookmark(Object arg0) throws SQLException {
+        checkDisposed();
+        int bookmark;
+        try {
+            bookmark = AnyConverter.toInt(arg0);
+        } catch (IllegalArgumentException illegalArgumentException) {
+            throw new SQLException("Bad bookmark", this, 
StandardSQLState.SQL_INVALID_BOOKMARK_VALUE.text(), 0, null);
+        }
+        return bookmark;
+    }
+
+    public synchronized boolean moveRelativeToBookmark(Object arg0, int arg1) 
throws SQLException {
+        checkDisposed();
+        int bookmark;
+        boolean moved = false;
+        try {
+            bookmark = AnyConverter.toInt(arg0);
+            moved = absolute(bookmark);
+            if (moved) {
+                moved = relative(arg1);
+            }
+        } catch (IllegalArgumentException illegalArgumentException) {
+        }
+        if (!moved) {
+            afterLast();
+        }
+        return moved;
+    }
+
+    public synchronized boolean moveToBookmark(Object arg0) throws 
SQLException {
+        checkDisposed();
+        int bookmark;
+        boolean moved = false;
+        try {
+            bookmark = AnyConverter.toInt(arg0);
+            moved = absolute(bookmark);
+        } catch (IllegalArgumentException illegalArgumentException) {
+        }
+        if (!moved) {
+            afterLast();
+        }
+        return moved;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java?rev=1814552&view=auto
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
 (added)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
 Wed Nov  8 04:17:25 2017
@@ -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;
+    }
+}

Propchange: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/CustomResultSetMetaData.java
------------------------------------------------------------------------------
    svn:eol-style = native

Copied: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
 (from r1814551, 
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java)
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java?p2=openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java&p1=openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java&r1=1814551&r2=1814552&rev=1814552&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/sdbc_postgresql/src/com/sun/star/sdbcx/comp/postgresql/DatabaseMetaDataResultSet.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DatabaseMetaDataResultSet.java
 Wed Nov  8 04:17:25 2017
@@ -19,7 +19,7 @@
  * 
  *************************************************************/
 
-package com.sun.star.sdbcx.comp.postgresql;
+package org.apache.openoffice.comp.sdbc.dbtools.util;
 
 import java.util.ArrayList;
 
@@ -232,7 +232,7 @@ public class DatabaseMetaDataResultSet e
     
     public synchronized XResultSetMetaData getMetaData() throws SQLException {
         checkDisposed();
-        return new 
PostgresqlResultSetMetaData(implResultSetMetaDataSupplier.getMetaData());
+        return implResultSetMetaDataSupplier.getMetaData();
     }
 
     // XRow:

Modified: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java?rev=1814552&r1=1814551&r2=1814552&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/DbTools.java
 Wed Nov  8 04:17:25 2017
@@ -36,6 +36,8 @@ import com.sun.star.container.ElementExi
 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.XColumnsSuppli
 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);
+        }
+    }
 }

Modified: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java?rev=1814552&r1=1814551&r2=1814552&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/ORowSetValue.java
 Wed Nov  8 04:17:25 2017
@@ -26,6 +26,7 @@ import java.io.UnsupportedEncodingExcept
 
 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;
@@ -291,10 +293,182 @@ public class ORowSetValue {
             flags |= FLAG_NULL;
         }
     }
+    
+    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 Any getAny() {
-        Any any = (Any)value;
-        return new Any(any.getType(), any.getObject());
+    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:

Modified: 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
URL: 
http://svn.apache.org/viewvc/openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java?rev=1814552&r1=1814551&r2=1814552&view=diff
==============================================================================
--- 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
 (original)
+++ 
openoffice/trunk/main/connectivity/java/dbtools/src/org/apache/openoffice/comp/sdbc/dbtools/util/Resources.java
 Wed Nov  8 04:17:25 2017
@@ -23,6 +23,9 @@ package org.apache.openoffice.comp.sdbc.
 
 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 );
+    public static final int STR_LOG_CLEAR_PARAMETERS           = ( 
STR_JDBC_LOG_MESSAGE_BASE + 47 );
+    public static final int STR_LOG_META_DATA_METHOD           = ( 
STR_JDBC_LOG_MESSAGE_BASE + 48 );
+    public static final int STR_LOG_META_DATA_METHOD_ARG1      = ( 
STR_JDBC_LOG_MESSAGE_BASE + 49 );
+    public static final int STR_LOG_META_DATA_METHOD_ARG2      = ( 
STR_JDBC_LOG_MESSAGE_BASE + 50 );
+    public static final int STR_LOG_META_DATA_METHOD_ARG3      = ( 
STR_JDBC_LOG_MESSAGE_BASE + 51 );
+    public static final int STR_LOG_META_DATA_METHOD_ARG4      = ( 
STR_JDBC_LOG_MESSAGE_BASE + 52 );
+    public static final int STR_LOG_META_DATA_RESULT           = ( 
STR_JDBC_LOG_MESSAGE_BASE + 53 );
+    public static final int STR_LOG_META_DATA_SUCCESS          = ( 
STR_JDBC_LOG_MESSAGE_BASE + 54 );
+    public static final int STR_LOG_THROWING_EXCEPTION         = ( 
STR_JDBC_LOG_MESSAGE_BASE + 55 );
+    public static final int STR_LOG_SETTING_SYSTEM_PROPERTY    = ( 
STR_JDBC_LOG_MESSAGE_BASE + 56 );
 }


Reply via email to