← Back to team overview

maria-developers team mailing list archive

New CONNECT table type JDBC

 

Hi Sergei,

In response to a feature request (see MDEV-9765) I have developed a first version of a JDBC table type for CONNECT.

Directly calling JDBC drivers from C++ seems difficult. JDBC drivers are designed to be called from Java applications and the issue is that the JDBC API can have parameters or return Java classes or objects. In addition they often throw Java Exceptions.

From C++, Java code can be called using the JNI interface but handling the above problems is combersome. This is why, at least in a first version, I have written a Java class (JdbcInterface) that calls JDBC functions with proper objects and takes care of Exceptions. CONNECT uses JNI to call this intermediate class.

How can this be distributed?

The Java JdbcInterface.class must be accessible in the CLASSPATH that is defined when installing JDBC drivers. When compiling MariaDB, this means also that the source file JdbcInterface.java must be compiled along with the rest of the CONNECT source files.

I have no idea on how this can be achieved.

Regards,

Olivier


References