Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


On 13/01/17 13:44, Bunth Tamás wrote:
Hi,

I'd like to have a better understanding of how the hsqldb and jdbc drivers work.

Is there any wiki page for them like "FirebirdSQL" for firebird that I
couldn't find?

maybe there's some old page somewhere here

http://www.openoffice.org/dba/
https://wiki.openoffice.org/wiki/Category:Database

The code in connectivity/source/drivers/jdbc contains a bunch of java
function calls afais. So where are the java codes, and how does the
driver call them?

it looks like the jdbc driver uses JNI to call Java methods directly
from C++.

like this, the strings are method name and signature:

        jobject out =
callObjectMethod(t.pEnv,"getMetaData","()Ljava/sql/DatabaseMetaData;", mID)


i think there's some generic JDBC implementation in the JRE plus a
driver-specific part in the JDBC driver.

so for the hsqldb case, i would expect this to call into here:

workdir/UnpackedTarball/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java:
  public synchronized DatabaseMetaData getMetaData() throws SQLException {

another point is that we have (at least on Linux) segregated the JDBC
driver into a separate thread for performance reasons, as it turned out
that JNI calls on the main thread happen to be really slow.

see jdbc.component:

    environment="@CPPU_ENV@:affine" prefix="jdbc"

this means that every UNO call first goes via the affine UNO-UNO bridge
onto a separate thread into the C++ JDBC UNO component, then that calls
via JNI into the Java library, then the return value of that is
converted with some C++ UNO wrapper, then it goes back over the bridge
to the calling thread.




Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.