JDBC / ODBC connection

Hello everyone :slightly_smiling_face:,

We’ve been using n8n for a while, to harmonize the company’s workflows.
But the only blocking point for separate from another flow manager is to set up an ODBC or JDBC connection with a Progress OpenEDGE database in n8n.

We have the necessary ODBC drivers and we also have the .jar required for a connection JDBC.

We’ve tried v1.0 with python code but can’t get it to work, and we’ve tried building a docker image with npm odbc but can’t get it to work. :face_with_head_bandage:

We’d like to know if any of you have already succeeded or if you have any information that could help us.

We were also thinking create a new feature request.

Thank you in advance for your help and your time.

Hey @SauerWorkflow,

Welcome to the community :tada:

We don’t have any inbuilt support for ODBC / JDBC which are typically not used by JavaScript applications but as you have found there are some packages that try to add support for them although you will probably not be able to use your java package.

The best option would be to try the ODBC package and worth through the errors or ask the Progress team if they have a Node / NPM package for working with OpenEDGE.

Hello @Jon,

Thank you for your feedback.

Do you have any sites or documentation to recommend for correctly integrating the ODBC package?
We tried using docker compose and Dokerfile.

Hey @SauerWorkflow,

You would need to create a custom docker image and include the package, As to how you use it from a code node you would need to check the documentation for the package itself but I suspect it won’t be easy.

What error did you get previously when you tried and what did you do?

Hey @Jon ,

we managed to create the image with the following Dockerfile:


file odbcinst.ini in same folder of Dockerfile :
image

in the code node we tested the following:

we’re wondering whether we shouldn’t install the ODBC driver inside our docker container.
but we don’t know how to do it.

Hey @SauerWorkflow,

That looks like right to me for odbc and the error coming back is from the library itself so say it can’t connect to the database.

Does the odbc packge you are using require the driver to be in the container? From an n8n view you have loaded the package correctly and it can be imported so it is being picked up from here it is just a case of following the documentation for the package and for OpenEDGE to get connected.

Hello @Jon

we managed to connect to our database inside the n8n container using the docker exec command.
but when we execute this in the execute Command node of n8n run on infinite loop.
image

Thank you for your help.

Hey @SauerWorkflow,

That looks promising, Looking at your terminal output the commadn has not finished running as it has the SQL> prompt, From in n8n we are going to be waiting for the command to finish as well so until the command exits and goes back to the shell properly it will keep spinning.

Hello @Jon

after passing the correct odbc library to the container’s /usr/lib via the Dockerfile and creating the ODBCINI environment variable with the user node, it works correctly.

Hopefully, this will save some time.

Dockerfile :

Code n8n :

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.