#1 2014-08-22 12:35:15

Dennie
Member
Registered: 2014-08-22

Additional JDBC drivers

Hello,

I like to add a JTOpen (IBM Iseries) datasource, but it's not listed. Can I add a driverclass to selectlist myself?

Greetings Dennie

Offline

#2 2014-08-22 12:48:24

Haris Odobasic
datenwerke
Registered: 2014-08-22

Re: Additional JDBC drivers

Hello Dennie,

It's definitely possible to add support for other databases as long as JDBC compliant drivers exist. In fact, we have written several blog posts about this exact topic.
How to add support for additional databases

Example scripts:
Vertica
Sybase

You will only need to slightly modify the provided Groovy script to fit your data source but should any questions arise please feel free to ask.

Kind regards,

Haris Odobasic

Offline

#3 2014-08-22 14:51:38

Dennie
Member
Registered: 2014-08-22

Re: Additional JDBC drivers

Missed that one! Briljant solution.
I've created a Hook for the driver (see below), but the iSeries of IBM does not support offset queries. So I need to use a row_number function to emulate this. This results in an additional column in the resultset. Now ReportServer reports an indexOutOfBounds Exception when executing a preview (Connection Test and Column selection works OK). See the stacktrace below.

AddJTOpensupport.groovy

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.LimitQuery
import net.datenwerke.rs.base.service.dbhelper.queries.OffsetQuery
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


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

	public static final String DB_NAME = "JTOpen";
	public static final String DB_DRIVER = "com.ibm.as400.access.AS400JDBCDriver";
	public static final String DB_DESCRIPTOR = "DBHelper_JTOpen";

	@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 'values 1'; /* http://stackoverflow.com/questions/2775184/simple-db2-query-for-connection-validation */
	}

	@Override
	public LimitQuery getNewLimitQuery(Query nestedQuery, QueryBuilder queryBuilder) {
		return new LimitQuery(nestedQuery, queryBuilder){
			@Override
			public void appendToBuffer(StringBuffer buf) {
				nestedQuery.appendToBuffer(buf);
				buf.append(" fetch first ");
				buf.append(queryBuilder.getLimit()+1);
				buf.append(" rows only");
			}
		}
	}

	@Override
	public OffsetQuery getNewOffsetQuery(Query nestedQuery, QueryBuilder queryBuilder, ColumnNamingService columnNamingService) {
		return new OffsetQuery(nestedQuery, queryBuilder, columnNamingService){
			@Override
			public void appendToBuffer(StringBuffer buf) {
          buf.append("SELECT t.* FROM(");
          buf.append("SELECT s.*,ROW_NUMBER() OVER() AS RN FROM (");
          nestedQuery.appendToBuffer(buf);
          buf.append(") s ");
          buf.append(") t where t.RN > ");
          buf.append(queryBuilder.getOffset());
          buf.append(" and t.RN <= ");
          buf.append(queryBuilder.getLimit() + queryBuilder.getOffset());          
			}
		}
	}
}


def HOOK_NAME = "DATASOURCE_HELPER_JTOPEN"

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

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

Stacktrace

aug 22, 2014 4:43:19 PM net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl execute
WARNING: String index out of range: -9
java.lang.StringIndexOutOfBoundsException: String index out of range: -9
	at java.lang.String.substring(String.java:1875)
	at net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition.fromResultSetMetaData(TableDefinition.java:124)
	at net.datenwerke.rs.base.service.datasources.table.impl.TableDBDataSource.getTableDefinition(TableDBDataSource.java:161)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.createReport(TableReportEngine.java:260)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:187)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:148)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecute(TableReportEngine.java:90)
	at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:127)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:106)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:89)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl.execute(ReportExecutorRpcServiceImpl.java:381)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl.executeAs(ReportExecutorRpcServiceImpl.java:208)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$executeAs$10(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.executeAs(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$processCall$17(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.processCall(<generated>)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$service$23(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.service(<generated>)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
	at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2442)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2431)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Offline

#4 2014-08-22 15:12:24

Dennie
Member
Registered: 2014-08-22

Re: Additional JDBC drivers

This problem had to do with the length of the rownumber alias. I've changed it to length 9, but now I'm getting the following error:

aug 22, 2014 5:10:02 PM net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl execute
WARNING: For input string: ""
java.lang.NumberFormatException: For input string: ""
	at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
	at java.lang.Integer.parseInt(Integer.java:504)
	at java.lang.Integer.valueOf(Integer.java:582)
	at net.datenwerke.rs.base.service.reportengines.table.output.object.TableDefinition.fromResultSetMetaData(TableDefinition.java:124)
	at net.datenwerke.rs.base.service.datasources.table.impl.TableDBDataSource.getTableDefinition(TableDBDataSource.java:161)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.createReport(TableReportEngine.java:260)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:187)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecuteNormal(TableReportEngine.java:148)
	at net.datenwerke.rs.base.service.reportengines.table.TableReportEngine.doExecute(TableReportEngine.java:90)
	at net.datenwerke.rs.core.service.reportmanager.engine.ReportEngine.execute(ReportEngine.java:127)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:186)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:119)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:106)
	at net.datenwerke.rs.core.service.reportmanager.ReportExecutorServiceImpl.execute(ReportExecutorServiceImpl.java:89)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl.execute(ReportExecutorRpcServiceImpl.java:381)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl.executeAs(ReportExecutorRpcServiceImpl.java:208)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$executeAs$10(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.persist.jpa.JpaLocalTxnInterceptor.invoke(JpaLocalTxnInterceptor.java:66)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.executeAs(<generated>)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$processCall$17(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.processCall(<generated>)
	at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.CGLIB$service$23(<generated>)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415$$FastClassByGuice$$db9d07b2.invoke(<generated>)
	at com.google.inject.internal.cglib.proxy.$MethodProxy.invokeSuper(MethodProxy.java:228)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.security.service.security.aop.SecurityCheckInterceptor.invoke(SecurityCheckInterceptor.java:110)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at net.datenwerke.gf.service.gwtstacktrace.CatchStacktraceInterceptor.invoke(CatchStacktraceInterceptor.java:38)
	at com.google.inject.internal.InterceptorStackCallback$InterceptedMethodInvocation.proceed(InterceptorStackCallback.java:72)
	at com.google.inject.internal.InterceptorStackCallback.intercept(InterceptorStackCallback.java:52)
	at net.datenwerke.rs.core.server.reportexecutor.ReportExecutorRpcServiceImpl$$EnhancerByGuice$$a9d9a415.service(<generated>)
	at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:263)
	at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:178)
	at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:91)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:62)
	at com.google.inject.persist.PersistFilter.doFilter(PersistFilter.java:89)
	at com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:163)
	at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:58)
	at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:118)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:113)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2442)
	at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2431)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)

Offline

#5 2014-08-22 15:41:22

Thorsten J. Krause
Guest

Re: Additional JDBC drivers

Hi Dennie,

your query should not return additional columns, as ReportServer expects all column names to match a specific pattern (i.e. RS_COL_1).

From the queries in your script it looks as if your sql dialect is essentially identical to db2? if thats true you could try using the built-in db2 limit/offset queries.

Modify your script to use

	import net.datenwerke.rs.base.service.dbhelper.db.db2.DB2OffsetQuery;
	import net.datenwerke.rs.base.service.dbhelper.db.db2.DB2LimitQuery; 

(...)

	@Override
	public LimitQuery getNewLimitQuery(Query nestedQuery, QueryBuilder queryBuilder){
		return new DB2LimitQuery(nestedQuery, queryBuilder);
	}

	@Override
	public OffsetQuery getNewOffsetQuery(Query nestedQuery, QueryBuilder queryBuilder, ColumnNamingService columnNamingService) {
		return new DB2OffsetQuery(nestedQuery, queryBuilder, columnNamingService);
	}

Kind Regards,
Thorsten

#6 2014-08-22 18:00:41

Dennie
Member
Registered: 2014-08-22

Re: Additional JDBC drivers

That works great! That implementation is indeed much better! Thanks.

Offline

Board footer

Powered by FluxBB