#1 2015-09-23 19:03:29

Scott
Member
Registered: 2015-09-23

Can anyone help me with this error I'm getting on a new datasource?

I'm using Intersystems Caché so I had to add the jar and write my own groovy script.  It took me forever, but I finally got it to do a successful connection test!  However, when I tried to create a sample report I get the below error which I don't understand at all.  As you can see below, I commented out and removed the whole "limitQuery" and "OffsetQuery" thing.  Are those necessary?  I don't really understand any of the groovy file and I have read through the blog.  Any help would be appreciated.

Error
Query could not be prepared: Error preparing statement for executing the report query : SELECT * FROM (SELECT * FROM (SELECT TOP 10 * FROM HS_IHE_ATNA_Repository.Aggregation) wrappedQry) limitQry LIMIT 50 OFFSET 0 /* token: 6aab148a-927b-45d5-9dfd-724788e139ca */ /* currentuser: 3 */

And here is my cache.groovy that I wrote

package databasehelper;

import net.datenwerke.rs.scripting.service.scripting.scriptservices.GlobalsWrapper;
import net.datenwerke.rs.base.service.dbhelper.DatabaseHelper
import net.datenwerke.rs.base.service.dbhelper.hooks.DatabaseHelperProviderHook
import net.datenwerke.rs.base.service.dbhelper.queries.Query
import net.datenwerke.rs.base.service.dbhelper.querybuilder.ColumnNamingService
import net.datenwerke.rs.base.service.dbhelper.querybuilder.QueryBuilder
/*
*import net.datenwerke.rs.base.service.dbhelper.queries.LimitQuery
*import net.datenwerke.rs.base.service.dbhelper.queries.OffsetQuery
*/
import net.datenwerke.rs.base.service.dbhelper.db.db2.DB2OffsetQuery
import net.datenwerke.rs.base.service.dbhelper.db.db2.DB2LimitQuery

/*
* @see: http://blog.datenwerke.net/2013/06/adding-support-for-additional-databases.html
*/
class Cache extends DatabaseHelper {

	public static final String DB_NAME = "Cache";
	public static final String DB_DRIVER = "com.intersys.jdbc.CacheDriver";
	public static final String DB_DESCRIPTOR = "DBHelper_Cache";

	@Override
	public String getDescriptor() {
		return DB_DESCRIPTOR;
	}

	@Override
	public String getDriver() {
		return DB_DRIVER;
	}

	@Override
	public String getName() {
		return DB_NAME;
	}

	@Override
	public String createDummyQuery() {
    return 'SELECT TOP 1 * FROM HS_IHE_ATNA_Repository.Aggregation'
    }

}


def HOOK_NAME = "DATASOURCE_HELPER_Cache"

def callback =  [
			provideDatabaseHelpers : {
				return Collections.singletonList(new Cache());
			}
		] as DatabaseHelperProviderHook;

GLOBALS.services.callbackRegistry.attachHook(HOOK_NAME, DatabaseHelperProviderHook.class, callback)

Offline

Board footer

Powered by FluxBB