Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Connection problem to SQL Server Database from BIRT RE 3.7.1
Connection problem to SQL Server Database from BIRT RE 3.7.1 [message #816005] Thu, 08 March 2012 09:55 Go to next message
Claude B is currently offline Claude BFriend
Messages: 32
Registered: February 2012
Member
Hi all,

I'm trying to run reports using BIRT Report Engine 3.7.1 and I want to generate its html output, here is my code:
package calcul;

import java.util.HashMap;
import java.util.logging.Level;

import org.eclipse.birt.core.framework.Platform;
import org.eclipse.birt.report.engine.api.EngineConfig;
import org.eclipse.birt.report.engine.api.EngineException;
import org.eclipse.birt.report.engine.api.HTMLRenderOption;
import org.eclipse.birt.report.engine.api.IReportEngine;
import org.eclipse.birt.report.engine.api.IReportEngineFactory;
import org.eclipse.birt.report.engine.api.IReportRunnable;
import org.eclipse.birt.report.engine.api.IRunAndRenderTask;


public class Executer {

	public static void main(String[] args) {
		try {
			Executer.executeReport();			
		} catch (EngineException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	public static void executeReport() throws EngineException
	{

	IReportEngine engine=null;
	EngineConfig config = null;

	try{
		config = new EngineConfig( );			
		//config.setBIRTHome("C:\\K\\ReportEngine");
		config.setLogConfig("c:/temp/test", Level.FINEST);
		Platform.startup( config );
		IReportEngineFactory factory = (IReportEngineFactory) Platform
		.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
		engine = factory.createReportEngine( config );		

		IReportRunnable design = null;
		//Open the report design
		design = engine.openReportDesign("rapports/rapport1.rptdesign"); 
		IRunAndRenderTask task = engine.createRunAndRenderTask(design); 		
		//task.setParameterValue("Top Count", (new Integer(5)));
		//task.validateParameters();
				
		HTMLRenderOption options = new HTMLRenderOption();		
		options.setOutputFileName("rapports/rapport1.html");
		options.setOutputFormat("html");
		//options.setHtmlRtLFlag(false);
		//options.setEmbeddable(false);
		//options.setImageDirectory("C:\\test\\images");

		task.setRenderOption(options);
		task.run();
		task.close();
		engine.destroy();
	}catch( Exception ex){
		ex.printStackTrace();
	}		
	finally
	{
	       Platform.shutdown( );
	}
	}
	
}



When I run a simple report using connection to the jdbc:classicmodels:sampledb database or to a local MySQL database (after importing the MySQL driver), I get no errors. But when I run a report using connection to an external SQL Server database, I get the following error:

Mar 8, 2012 10:45:57 AM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>
SEVERE: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
Mar 8, 2012 10:45:58 AM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>
SEVERE: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

I added the SQL Server driver (sqljdbc4.jar) to my libraries (exactly like the working MySQL driver), I even imported it as an external library but I'm always getting the same error.
The same report works perfectly using BIRT Designer 3.7.1

PS:
My JAVA version is 1.6.0.07
I'm using Eclipse BIRT 3.7.1
Re: Connection problem to SQL Server Database from BIRT RE 3.7.1 [message #816519 is a reply to message #816005] Thu, 08 March 2012 23:56 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Do you have any other versions of the driver in your classpath? When
you are in the designer what jars show up in the Manage Jdbc Drivers dialog?
http://www.eclipse.org/forums/index.php/m/768875/

Jason

On 3/8/2012 4:55 AM, Claude B wrote:
> Hi all,
>
> I'm trying to run reports using BIRT Report Engine 3.7.1 and I want to
> generate its html output, here is my code:
>
> package calcul;
>
> import java.util.HashMap;
> import java.util.logging.Level;
>
> import org.eclipse.birt.core.framework.Platform;
> import org.eclipse.birt.report.engine.api.EngineConfig;
> import org.eclipse.birt.report.engine.api.EngineException;
> import org.eclipse.birt.report.engine.api.HTMLRenderOption;
> import org.eclipse.birt.report.engine.api.IReportEngine;
> import org.eclipse.birt.report.engine.api.IReportEngineFactory;
> import org.eclipse.birt.report.engine.api.IReportRunnable;
> import org.eclipse.birt.report.engine.api.IRunAndRenderTask;
>
>
> public class Executer {
>
> public static void main(String[] args) {
> try {
> Executer.executeReport();
> } catch (EngineException e) {
> // TODO Auto-generated catch block
> e.printStackTrace();
> }
> }
> public static void executeReport() throws EngineException
> {
>
> IReportEngine engine=null;
> EngineConfig config = null;
>
> try{
> config = new EngineConfig( );
> //config.setBIRTHome("C:\\K\\ReportEngine");
> config.setLogConfig("c:/temp/test", Level.FINEST);
> Platform.startup( config );
> IReportEngineFactory factory = (IReportEngineFactory) Platform
> .createFactoryObject(
> IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
> engine = factory.createReportEngine( config );
>
> IReportRunnable design = null;
> //Open the report design
> design = engine.openReportDesign("rapports/rapport1.rptdesign");
> IRunAndRenderTask task = engine.createRunAndRenderTask(design);
> //task.setParameterValue("Top Count", (new Integer(5)));
> //task.validateParameters();
>
> HTMLRenderOption options = new HTMLRenderOption();
> options.setOutputFileName("rapports/rapport1.html");
> options.setOutputFormat("html");
> //options.setHtmlRtLFlag(false);
> //options.setEmbeddable(false);
> //options.setImageDirectory("C:\\test\\images");
>
> task.setRenderOption(options);
> task.run();
> task.close();
> engine.destroy();
> }catch( Exception ex){
> ex.printStackTrace();
> }
> finally
> {
> Platform.shutdown( );
> }
> }
>
> }
>
>
>
> When I run a simple report using connection to the
> jdbc:classicmodels:sampledb database or to a local MySQL database (after
> importing the MySQL driver), I get no errors. But when I run a report
> using connection to an external SQL Server database, I get the following
> error:
>
> Mar 8, 2012 10:45:57 AM com.microsoft.sqlserver.jdbc.SQLServerConnection
> <init>
> SEVERE: Java Runtime Environment (JRE) version 1.6 is not supported by
> this driver. Use the sqljdbc4.jar class library, which provides support
> for JDBC 4.0.
> Mar 8, 2012 10:45:58 AM com.microsoft.sqlserver.jdbc.SQLServerConnection
> <init>
> SEVERE: Java Runtime Environment (JRE) version 1.6 is not supported by
> this driver. Use the sqljdbc4.jar class library, which provides support
> for JDBC 4.0.
>
> I added the SQL Server driver (sqljdbc4.jar) to my libraries (exactly
> like the working MySQL driver), I even imported it as an external
> library but I'm always getting the same error.
> The same report works perfectly using BIRT Designer 3.7.1
>
> PS:
> My JAVA version is 1.6.0.07
> I'm using Eclipse BIRT 3.7.1
Re: Connection problem to SQL Server Database from BIRT RE 3.7.1 [message #816765 is a reply to message #816519] Fri, 09 March 2012 08:31 Go to previous message
Claude B is currently offline Claude BFriend
Messages: 32
Registered: February 2012
Member
Thank you Jason, I had to remove the sqljdbc.jar from library
that's ok now Smile
Previous Topic:How to resize crosstab cell
Next Topic:Rounded corners on a table via CSS in BIRT
Goto Forum:
  


Current Time: Fri Apr 26 23:36:51 GMT 2024

Powered by FUDForum. Page generated in 0.03269 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top