Grails integration

Find out how to integrate JSQL with Java EE

Stack requirements

The JSQL Grails plugin will not work without an account in the JSQL cloud and a application written in Grails. To learn more see overview.

Your backend application should have property configured database connection. For more details see  datasource configuration.

Installation

Add JSQL artifactory into your maven repositories in your project.

For Maven setup:

<repositories>
    <repository>
        <id>maven</id>
        <url>http://46.41.135.99:8081/artifactory/libs-release-local/</url>
    </repository>
</repositories>

For Gradle setup:

repositories {

    mavenCentral()
    maven{
        url "http://46.41.135.99:8081/artifactory/libs-release-local"
    }

}

Then add jsql-grails-plugin dependency:

Releases list

For Maven setup:

<dependency>
    <groupId>it.jsql.connector.grails</groupId>
    <artifactId>jsql-grails-plugin</artifactId>
    <version>1.0.0.</version>
</dependency>

For Gradle setup:

compile(group: 'it.jsql.connector.grails', name: 'jsql-grails-plugin', version: '1.0')

Integration

The JSQL plugin for Grails has very simple configuration. All you need to do is provide API_KEY and DEV_KEY.

The API_KEY and DEV_KEY we can get from JSQL Admin Panel, see FAQ for details.

You should store them in application.groovy file:

jsql.apiKey = 'iSqF8rKvVeSgqudKDOXpjiFgGMJh1PbeouIz9IW/YQ==9CI8ox66gogpoSXm6yrU'
jsql.memberKey = 'Z6kEovODxAv2I5hKekMyUw=='

Usage

If your application is integrated using the JSQL plugin, you can start it and try to call the query using CURL:

curl 'http://localhost:8080/jsql/select' -H 'Accept: application/json' -H 'Content-Type: application/json' 
--data-binary '{"token":"select * from person","params":{}}' --compressed

What next?

Close Menu