Code Monkey home page Code Monkey logo

exasol-java-tutorial's Introduction

Exasol Java tutorial

Build Status

Quality Gate Status

Security Rating Reliability Rating Maintainability Rating Technical Debt

Code Smells Coverage Duplicated Lines (%) Lines of Code

If you are a Java developer and you are thinking about extending Exasol with new functionality, this tutorial takes you on a tour around Exasol's interfaces and the libraries we provide.

Not only do you learn how to implement User Defined Functions (UDF) in Java, but you also will see how to run automated integration tests.

Topics we are touching in the tutorials:

  • Scalar Script UDF (a script with a single input)
  • Java code inlined into SQL code
  • Java UDFs provided as JAR archives
  • Exasol Scripting API for Java
  • How to get an Exasol instance you can test against in automated tests
  • How to set up tests and prepare test data
  • How to check the results from SQL queries in a compact and readable way

Tutorials

Hello World!

Start your journey with the obligatory hello world tutorial to learn the basics of defining an inline Java extension that can be called from SQL.

Markdown Statistics as User Defined Function

Up your game with a full-blown automated integration test that exercises a more complex Java extension that gets statistics from Markdown text stored in an Exasol table. Learn to package the installation in a JAR archive in the course of this tutorial.

TLS Tutorial

Setting up TLS is all but trivial in some scenarios, so a series of articles and some software examples guide you through the process.

  1. Introduction to TLS
  2. TLS with Exasol (theoretical part)
  3. Using Your Own Certificates to run IMPORT from MySQL into Exasol
  4. TLS in User Defined Functions (UDFs)

Java Testing Tutorial

Additional Information

exasol-java-tutorial's People

Contributors

ckunki avatar dejanmihajlovic avatar kaklakariada avatar nicoretti avatar pj-spoelders avatar redcatbear avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

exasol-java-tutorial's Issues

Add general "TLS with Exasol" article

Situation

So far we have an introduction to TLS and an article that focuses on TLS in UDFs in particular. What is missing is a part about TLS with Exasol in general.

Acceptance Criteria

  • TLS tutorial contain an article about general TLS with Exasol (especially the loader).

TLS tutorial findings

TLS in User Defined Functions (UDFs)

TLS With Exasol

  • "For a truly secure connection, you need to put in place a custom server certificate immediately after installing EXAOperation.": Logically, we are talking rather about installing cluster / DB.
  • "The certificate is signed by an Exasol Certification Agency (CA) and your machine does not have that CA’s certificate pre-installed": Really? For my Exasol Community Edition default certificate chain consists of only 0 level.

Using Your Own Certificates

  • "Open SSL": an unneeded space.
  • "certificate extensions.To": a space is missing.
  • "This header can be used for find a set of options in the configuration file" -> finding?
  • "information. : The key": an unneeded colon.
  • "You could drop that option if you wanted, because this is the default for certificates." -> want?
  • "No we are all set to install the certificates." -> Now?
  • "win any price" -> prize?
  • "/etc/mysql/mysql.conf.d/mysqld.cnf ": unneeded space is highlighted.
  • "OpenSSL's sclient" -> s_client?
  • "MySQl" -> MySQL?
  • "Copy the driver to the default Bucket" should, probably, refer to MySQL JDBC driver, not to tls-tutorial.jar. Applies to the remainder of "Installing the MySQL JDBC driver in Exasol" section as well.
  • Formatting right after "You are now set up and ready to run the import." is broken.

Java testing tutorial

Situation

Automatic testing is essential for professional software development. Without automated tests software will accumulate regressions or simply be faulty from the start.

This tutorial addresses important considerations for a successful test automation and strategy, gives concrete examples and shows how to conveniently incorporate TDD into your workflows.

Acceptance Criteria

  • Testing tutorial text exists
  • Java example project exists

Add command examples for securing a custom truststore in a private bucket.

Situation

We have a general description in tls_in_udfs.md at the moment on how to secure a truststore in a private bucket. Aleks pointed out that the commands mentioned sound so similar that users might confuse them. Better be safe and add a concrete example.

Acceptance Criteria

  • Commands for securing bucket are available.

sudo apt upgrade; sudo snap install docker

(1)
vm with dynamic allocaded RAM
sudo apt upgrade => seems that this upgraded too much => no space left on device

(2)
second try, new plain Ubuntu VM
did not use sudo apt upgrade

sudo apt install docker.io
Reading package lists... Done Building dependency tree... Done Reading state information... Done Package [docker.io](http://docker.io/) is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package '[docker.io](http://docker.io/)' has no installation candidate
=>sudo snap install docker installed docker
tested it with docker -v

Simple scalar scripts

Acceptance Criteria

  1. Introduced the simplest possible "hello world".
  2. Introduced a scalar set script deployed as JAR.

Mutli-module CI build

Situation

Currently the CI build scripts created by Project Keeper are for a single module Maven build. Since there are multiple tutorials in this project, we use a multi-module Maven build. As a result the standard CI builds don't look for the build artifacts (JARs) in the right directory. They look in 'target/', but there are multiple directories in the form of <sub-module>/target/ that actually need to be scanned.

Additionally, we need to take the release artifacts from those directories.

Acceptance Criteria

  • CI handles multi-module build correctly

Add hands-on tutorial for IMPORT with TLS

Situation

Installing TLS certificates correctly is the precondition for getting an IMPORT running using the EXALoader when the service you are importing from uses a server certificate signed by the organizations own CA. This is a very typical scenario on-premise.

Acceptance Criteria

  • Step-by-step tutorial exists that demonstrates an IMPORT in a scenario with organization issued TLS certificates.

Nitpick/Question regarding digital signatures part

The following sentence:

If Bob wants to digitally sign data, he first calculates a tamper-proof representation of that data that is smaller. That proof is a large number calculated from the contents of the data payload. The chosen algorithm does not allow reversing the process with any realistic effort. That means while Alice will be able to calculate the same number from the payload, Eve can’t create any meaningful data out of the number. This so called 'one-way hash function' is the foundation of digital signatures. Bob then uses his private key to encrypt the one-way hash and puts it alongside the payload data.

is a bit overloaded from my point of view. Even though technically I understand that the signature is smaller, I'm not sue if that information is relevant for most readers. I even think it can distract from the more relevant properties (more relevant in the context of the target/reader audience) like that it is tamper-proof.

TL;DR:

  • Why is it relevant to the reader that the signature is smaller and how it looks like?
    (Isn't the relevant information just that it is tamper-proof and maybe that it is based on the content?)

Upgrade dependencies to fix vulnerable dependency postgresql

Error:    org.postgresql:postgresql:jar:42.2.23.jre7:test; https://ossindex.sonatype.org/component/pkg:maven/org.postgresql/[email protected]?utm_source=ossindex-client&utm_medium=integration&utm_content=1.1.1
Error:      * [CVE-2022-21724] pgjdbc is the offical PostgreSQL JDBC Driver. A security hole was found in the j... (9.8); https://ossindex.sonatype.org/vulnerability/0f319d1b-e964-4471-bded-db3aeb3c3a29?component-type=maven&component-name=org.postgresql.postgresql&utm_source=ossindex-client&utm_medium=integration&utm_content=1.1.1

πŸ” CVE-2024-25710: org.apache.commons:commons-compress:jar:1.24.0:test

Summary

Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in Apache Commons Compress.This issue affects Apache Commons Compress: from 1.3 through 1.25.0.

Users are recommended to upgrade to version 1.26.0 which fixes the issue.

CVE: CVE-2024-25710
CWE: CWE-835

References

Add expiry to output of the certificates UDF

Situation

We just had a situation where a user forgot to refresh outdated certificates and was wondering what is going on.
Adding the expiry date to the list output of the certificate script would be helpful in such a situation.

Acceptance Criteria

  1. Expiry date in the result set of the CERTIFICATES() UDF

Port TLS introduction from blog article

Situation

We already have an article on the Exasol blog that gives an introduction to TLS. But it would be good to have everything in one place. From the introduction to the UDF that checks the CA certificate installation.

Acceptance Criteria

  • Blog article ported to Markdown
  • Article available in this repository

πŸ” CVE-2024-26308: org.apache.commons:commons-compress:jar:1.24.0:test

Summary

Allocation of Resources Without Limits or Throttling vulnerability in Apache Commons Compress.This issue affects Apache Commons Compress: from 1.21 before 1.26.

Users are recommended to upgrade to version 1.26, which fixes the issue.

CVE: CVE-2024-26308
CWE: CWE-770

References

Missing TLS Step (Part 1)

I copied my ca.crt to Exasol-DB

pesm@pesm-VirtualBox:~/tutorials/tls_with_exasol/import$ docker cp "ca.crt" exasoldb:/root

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.