In addition to utilizing Kiss as a web application development system, Kiss also provides a command line interface. This interface allows you to build quick but powerful utilities to do things like updating a database, parsing a CSV file, interfacing with a third-party REST service, and more. Basically, all of Kiss is available except the Kiss REST server.
Although this system supports PostgreSQL out-of-the-box, it also supports any of the other databases with a slightly more complex command line.
The build system (bld) has the ability to build a JAR file named KissGP.jar. The GP stands for Groovy and PostgreSQL. Basically, it is a JAR file capable of running Groovy scripts in the context of all of the Kiss utilities including access to a PostgreSQL database.
(It should be noted that although Groovy scripts are text / source files, they nevertheless run at full compiled speed because they are compiled at runtime.)
To build the JAR file, type the following:
./bld KissGP
A file named KissGP.jar will be created in the work directory. That, in addition to the JDK, is all that is needed to use the system.
To use the Kiss command line interface you first create the Groovy program you would like to run. It may use all of the Groovy and Kiss APIs. For example, let’s start with something simple. Create the following file named test1.groovy:
static void main(String [] args) { println "Hello world!" }
You can then run the program as follows:
java -jar KissGP.jar test1
test1.groovy can be extended arbitrarily to perform any function needed.
Although KissGP.jar comes bundled with support for the PostgreSQL database, KissGP.jar can support databases other than PostgreSQL by adding the driver for the database and using a slightly more complex command line as follows.
To use KissGP.jar with Microsoft SQL Server, for example, you’d have to include the database driver for it in addition to the KissGP.jar file and the file with your program. The command line would look as follows:
java -cp mssql-jdbc-8.2.0.jre8.jar -jar KissGP.jar test1
The same is true of the other databases. Please note that the drivers you’ll need are already in the libs directory.