Skip to content

Latest commit

 

History

History
62 lines (36 loc) · 2.37 KB

README.md

File metadata and controls

62 lines (36 loc) · 2.37 KB

dyna4JDBC

A JDBC driver for running alternative JVM language scripts and external programs.

Introduction

dyna4JDBC is a JDBC driver, that allows running alternative JVM language scripts (Groovy, JavaScript, Scala, Jython, Clojure, BeanShell, R (Renjin), JRuby etc.) or external console-oriented programs via the JDBC API.

Mainly targeted at allowing JDBC-enabled business intelligence applications to run various scripts instead of SQL easily, dyna4JDBC captures and parses the output of scripts/external programs and presents that as a standard JDBC ResultSet, allowing the output to be processed further for various purposes like building complex reports quickly and analysis with other tools.

Documentation

For further information, please check out the

Sample

NOTE: This is just a sample - the project's primary goal is empowering Java Reporting and ETL applications to call dynamic script langauges through the JDBC API, and NOT programmatic usage.

package sample;

import java.sql.*;

public class HelloWorldSample {

    public static void main(String[] args) throws SQLException {

        String url = "jdbc:dyna4jdbc:scriptengine:JavaScript";

        try (Connection connection = DriverManager.getConnection(url)) {

            try (Statement statement = connection.createStatement()) {

                statement.executeUpdate(" var msg = 'Hello World'; ");
                try (ResultSet resultSet = statement.executeQuery(" print(msg); ")) {
                    while (resultSet.next()) {
                        String string = resultSet.getString(1);

                        System.out.println(string);
                    }
                }

            }
        }
    }
}

Download

Please visit Maven Central or the the release download section to download the binary version of dyna4jdbc JDBC driver.

Build Status

Build Status

Continuous integration platform is provided by Travis CI