Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-13388

CONNECT Engine shows no support for JDBC




      I am trying to get the CONNECT JDBC engine to work with any one of the following environments: Mac Sierra using either MacPorts or HomeBrew, Docker container with Alpine as a base and adding into it OpenJDk8, MariaDB-10.1.22.

      First, I have been able to get all the way through on an Ubuntu 16.04 system and was able to use the JDBC CONNECT engine along with a 3rd party JDBC driver for Excel and created a table connected to my excel file, which is my ultimate goal. I mention this because in getting that to work, I had to work through a number of hurdles so overall I'm aware of the needed steps to get this to work. I replicated my steps in a VirtualBox VM running Ubuntu 16.04 that oddly had one glaring issue, but I was able to resolve it by not autostarting mariaDB and instead running it from the command line using mysqld_safe. That problem I may report in another issue, it's somewhat related but there was a workaround to get that to work, not so with these other environments.

      I'll highlight the general steps I've taken on the docker alpine system and where I'm stopped:

      • Install openJDK8, MariaDB-10.1.22 using apk (I'm using packages, not compiling from source).
      • install the initial databases using mysql_install_db
      • Start mariadb server
      • Set root password for server.
      • Run mysql command line client and confirm that mysql server is up and running
      • Run: INSTALL SONAME 'ha_connect.so'; no problems here
      • Confirm that the CONNECT engine is loaded and active using SHOW ENGINES and SHOW PLUGINS, it's listed and active in both places.
      • I copied JdbcInterface.jar that I built on my mac against version 10.1.24. I placed the jar file inside /usr/lib/mysql/plugins/ folder (same location as ha_connect.so). I do not believe this is the issue since if it were not present I should get msg when I try to CREATE TABLE that the jar file cannot be found, I never get that far.
      • At this point on the Ubuntu systems that I got to work, I would add the following to my my.cnf file under the [mysqld] section:

      connect_class_path=<path to Java ext folder>. This is ultimately where my 3rd party driver files go.
      connect_jvm_path=<path to libjvm.so located in java jre subfolder>

      This is where I'm stuck, when I stop/start my mariaDB server it won't start and complains that those 2 parameters are unknown (Don't remember the exact language).

      If I remove them, start my server and then run:

      mysqladmin -u root -p<mypass> variables | grep connect 

      it shows all matching variables that have 'connect' in the name. I do see some of the CONNECT engine variables, such as connect_conv_size and most of the others, but connect_class_path, connect_jvm_path and connect_java_wrapper are not listed.

      I am afraid at this point I'm stuck. I'd be happy to start seeing 'can't find JdbcInterface.jar' but I am not at that point yet, seems the CONNECT engine is behaving like there is no support at all for JDBC.

      I ran into this on my mac as well using MacPort and Homebrew and I might add all of these have been different mariadb versions:

      Alpine: Provides MariaDb-10.1.22, used OpenJDK8
      Official MariaDB container on docker, this uses Debian, I installed 10.1 server and oracle JDK8
      Macports: Provides MariaDB-10.1.24, also used Oracle JDK8
      HomeBrew: Provides 10.2.7 (or maybe 10.2.6 but at least that). Used Oracle Java JDK8
      Ubuntu 16.04: Provides 10.2.6/7 (I used an alternate repository to get 10.2 series installed here). I also used Oracle Java8 on this system

      Just to circle back quickly to Ubuntu, once I set those variables which were simply present as soon as I activated the connect engine, then put the JdbcInterface.jar in the right place and my 3rd party JDBC Excel Driver, I was off and running. The problem so far is I really need to be able to get this working locally for me. For now I'm managing with a VirtualBox VM but I would really prefer to run MariaDB directly on my mac. Everything but the JDBC Connect engine works just fine on my Mac. Failing that a docker container would be my next choice, but so far I have not had any luck. Docker may in fact be preferred as I can then deploy this setup more easily to other staff at my company.

      I don't know if I am missing certain library files or if for some reason I need to configure java environment variables (I never did on the ubuntu systems). but I am really stuck. There are no errors in the startup log file so I don't know what else to try. Any help would be greatly appreciated.

      One additional note, a few weeks ago when I was trying to get this to work on my Mac, I was able to use the CONNECT engine and CSV files to link a CSV file to a table in my mariadb database so the CONNECT engine does generally work on Mac, but the JDBC table type does not.

      If I get this all to work with docker I'll be posting it to Docker Hub which will make it easier for others to play around with the CONNECT engine and JDBC. If I'm successfull, I'll circle back to this issue and report the docker hub name of the container for others.




            bertrandop Olivier Bertrand
            dlangh Donald Langhorne
            0 Vote for this issue
            4 Start watching this issue



                Git Integration