Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » BIRT and MSSQL: No suitable driver found for jdbc:
BIRT and MSSQL: No suitable driver found for jdbc: [message #840299] Mon, 09 April 2012 23:24 Go to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Hello, all:

Could someone help me with best way to have BIRT see the JDBC drivers...

I wrote a java class that connects to the msSQL, performs calculations and returns some numbers. This class has been tested in pure java and matlab. In both cases the code works without the glitch. For clarity let's call the class "ZZZ" and the package "com.mypackage"

I load the .jar file that contains the class via the "external jar" option and then use the ZZZ class from within BIRT via importPackage(Packages.com.mypackage) command.

Intantiation goes smoothly ie
var aaa = new ZZZ();
executes without problems.

when I call the methods, something like:
aaa.doDBthings();
I get the following error message:
java.sql.SQLException: No suitable driver found for jdbc:sqlserver://myServer;databaseName = wines;integratedSecurity=true;
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
....etc....etc....

Couple questions come to my mind.
1) Why does BIRT not see the jdbc drivers?
2) what should I do so that BIRT can see the suitable JDBC driver?
3) how can I set up my path if I do not have administator rights on a computer?
4) do I need to place sqljdbc4.jar (MSSQL jdbc driver) into a certain directory?
5) is this a BIRT problem or is this an ECLIPSE problem?

Thank you in advance,
Andrew

[Updated on: Mon, 09 April 2012 23:57]

Report message to a moderator

Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #840854 is a reply to message #840299] Tue, 10 April 2012 15:34 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Andrew

Are you getting this error in the designer? If so is the sql driver jar
already in your list of birt drivers? Ie manage drivers button on jdbc
data source editor? Do you get this error when deploying the report?

Jason


On 4/9/2012 7:24 PM, andrew smith wrote:
> Hello, all:
>
> Could someone help me with best way to have BIRT see the JDBC drivers...
>
> I wrote a java class that connects to the msSQL, performs calculations
> and returns some numbers. This class has been tested in pure java and
> matlab. In both cases the code works without the glitch. For clarity
> let's call the class "ZZZ" and the package "com.mypackage"
>
> I load the .jar file that contains the class via the "external jar"
> option and then use the ZZZ class from within BIRT via
> importPackage(Packages.com.mypackage) command.
>
> Intantiation goes smoothly ie var aaa = new ZZZ();
> executes without problems.
>
> when I call the methods, something like:
> aaa.doDBthings();, I get the following error message:
> java.sql.SQLException: No suitable driver found for
> jdbc:sqlserver://myServer;databaseName = wines;integratedSecurity=true;
> at java.sql.DriverManager.getConnection(Unknown Source)
> at java.sql.DriverManager.getConnection(Unknown Source)
> ....etc....etc....
> Couple questions come to my mind.
> 1) Why does BIRT not see the jdbc drivers? 2) what should I do so that
> BIRT can see the suitable JDBC driver?
> 3) how can I set up my path if I do not have administator rights on a
> computer?
>
> Thank you in advance, Andrew
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #841085 is a reply to message #840854] Tue, 10 April 2012 22:17 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

Thank for your response.
The sql drivers jar are already defined in the BIRT driver manager. I do not deploy the report per se, I click on the preview tab and then the error ('No suitable driver') in the console window of the eclipse(eclipsec.exe) pops up. I

The error in the BIRT RCP in the 'Problem' window is:

org.eclipse.birt.report.engine.api.EngineException: There are errors evaluating script "

// ---IMPORT PACKAGES
//importPackage(Packages.java.sql);
importPackage(Packages.com.myServer.research.Portfolio);
//importPackage(Packages.com.microsoft.sqlserver.jdbc);
//importPackage(Packages.java.io);
//System.out.println("================================");

// ---IMPORT PACKAGES

// --- DEFINE THE STRATEGY PROGRAM IDS
var ProgID_StatisticalArbitrage = "2456, 3456";
// --- DEFINE THE STRATEGY PROGRAM IDS

// --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
var jj = new Portfolio(ProgID_StatisticalArbitrage);
jj.makeEqualWeigthPortfolio();
//var pp = jj.resultVector.get(0);
jj.showResultVector;
//for(int i=0, i<pp.size,i++){
//print(pp.get(i));
//}
//print(jj.resultVector.get(1));
// --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES


// --- CALCULATE THE PORTFOLIO MONTHLY RETURNS

// --- CALCULATE THE PORTFOLIO MONTHLY RETURNS

":
Wrapped java.lang.NullPointerException (/report/method[@name="initialize"]#23) (Element ID:1)

at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:244)

at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:93)

at org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesign(EngineTask.java:1847)

at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:98)

at org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)

at org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:929)

at org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)

at org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131)

at org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)

at org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)

at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)

at org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)

at org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)

at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)

at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)

at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)

at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)

at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)

at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)

at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)

at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)

at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)

at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)

at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)

at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)

at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)

at org.mortbay.jetty.Server.handle(Server.java:326)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)

at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)

at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

Caused by: org.eclipse.birt.core.exception.CoreException: There are errors evaluating script "


// ---IMPORT PACKAGES
//importPackage(Packages.java.sql);
importPackage(Packages.com.myServer.research.Portfolio);
//importPackage(Packages.com.microsoft.sqlserver.jdbc);
//importPackage(Packages.java.io);
//System.out.println("================================");

// ---IMPORT PACKAGES

// --- DEFINE THE STRATEGY PROGRAM IDS
var ProgID_StatisticalArbitrage = "2456, 3456";
// --- DEFINE THE STRATEGY PROGRAM IDS

// --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
var jj = new Portfolio(ProgID_StatisticalArbitrage);
jj.makeEqualWeigthPortfolio();
//var pp = jj.resultVector.get(0);
jj.showResultVector;
//for(int i=0, i<pp.size,i++){
//print(pp.get(i));
//}
//print(jj.resultVector.get(1));
// --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES


// --- CALCULATE THE PORTFOLIO MONTHLY RETURNS

// --- CALCULATE THE PORTFOLIO MONTHLY RETURNS

":
Wrapped java.lang.NullPointerException (/report/method[@name="initialize"]#23)

at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)

at org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)

at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:781)

at org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:710)

at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:117)

at org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:104)

at org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:84)

... 53 more

Caused by: org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException (/report/method[@name="initialize"]#23)

at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)

at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)

at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)

at org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)

at org.mozilla.javascript.gen.c7._c0(/report/method[@name="initialize"]:23)

at org.mozilla.javascript.gen.c7.call(/report/method[@name="initialize"])

at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)

at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)

at org.mozilla.javascript.gen.c7.call(/report/method[@name="initialize"])

at org.mozilla.javascript.gen.c7.exec(/report/method[@name="initialize"])

at org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)

... 59 more

Caused by: java.lang.NullPointerException

at com.myServer.research.Portfolio.Portfolio.makeEqualWeigthPortfolio(Portfolio.java:81)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)

... 68 more




Thanks for your help.
Edgar
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #841631 is a reply to message #841085] Wed, 11 April 2012 15:15 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Do you have the driver in more than one place? When you use the manage
drivers button it copies the driver to the drivers directory of the jdbc
plugin.

Jason

On 4/10/2012 6:17 PM, andrew smith wrote:
> Jason,
> Thank for your response. The sql drivers jar are already defined in the
> BIRT driver manager. I do not deploy the report per se, I click on the
> preview tab and then the error ('No suitable driver') in the console
> window of the eclipse(eclipsec.exe) pops up. I
> The error in the BIRT RCP in the 'Problem' window is:
>
> org.eclipse.birt.report.engine.api.EngineException: There are errors
> evaluating script "
>
> // ---IMPORT PACKAGES
> //importPackage(Packages.java.sql);
> importPackage(Packages.com.myServer.research.Portfolio);
> //importPackage(Packages.com.microsoft.sqlserver.jdbc);
> //importPackage(Packages.java.io);
> //System.out.println("================================");
>
> // ---IMPORT PACKAGES
>
> // --- DEFINE THE STRATEGY PROGRAM IDS
> var ProgID_StatisticalArbitrage = "2456, 3456";
> // --- DEFINE THE STRATEGY PROGRAM IDS
>
> // --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
> var jj = new Portfolio(ProgID_StatisticalArbitrage);
> jj.makeEqualWeigthPortfolio();
> //var pp = jj.resultVector.get(0);
> jj.showResultVector;
> //for(int i=0, i<pp.size,i++){
> //print(pp.get(i));
> //}
> //print(jj.resultVector.get(1));
> // --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
>
>
> // --- CALCULATE THE PORTFOLIO MONTHLY RETURNS
>
> // --- CALCULATE THE PORTFOLIO MONTHLY RETURNS
>
> ":
> Wrapped java.lang.NullPointerException
> (/report/method[@name="initialize"]#23) (Element ID:1)
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.addException(ScriptExecutor.java:244)
>
>
> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:93)
>
>
> at
> org.eclipse.birt.report.engine.api.impl.EngineTask.loadDesign(EngineTask.java:1847)
>
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.doRun(RunAndRenderTask.java:98)
>
>
> at
> org.eclipse.birt.report.engine.api.impl.RunAndRenderTask.run(RunAndRenderTask.java:77)
>
>
> at
> org.eclipse.birt.report.service.ReportEngineService.runAndRenderReport(ReportEngineService.java:929)
>
>
> at
> org.eclipse.birt.report.service.BirtViewerReportService.runAndRenderReport(BirtViewerReportService.java:973)
>
>
> at
> org.eclipse.birt.report.service.actionhandler.BirtGetPageAllActionHandler.__execute(BirtGetPageAllActionHandler.java:131)
>
>
> at
> org.eclipse.birt.report.service.actionhandler.AbstractBaseActionHandler.execute(AbstractBaseActionHandler.java:90)
>
>
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseDocumentProcessor.__executeAction(AbstractBaseDocumentProcessor.java:47)
>
>
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.executeAction(AbstractBaseComponentProcessor.java:143)
>
>
> at
> org.eclipse.birt.report.soapengine.processor.BirtDocumentProcessor.handleGetPageAll(BirtDocumentProcessor.java:183)
>
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at
> org.eclipse.birt.report.soapengine.processor.AbstractBaseComponentProcessor.process(AbstractBaseComponentProcessor.java:112)
>
>
> at
> org.eclipse.birt.report.soapengine.endpoint.BirtSoapBindingImpl.getUpdatedObjects(BirtSoapBindingImpl.java:66)
>
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at
> org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
>
>
> at
> org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
>
>
> at
> org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
>
> at
> org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
>
>
> at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
>
> at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
>
> at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
>
> at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
>
> at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
>
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.doPost(BirtSoapMessageDispatcherServlet.java:265)
>
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
>
> at
> org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
>
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>
> at
> org.eclipse.birt.report.servlet.BirtSoapMessageDispatcherServlet.service(BirtSoapMessageDispatcherServlet.java:122)
>
>
> at
> org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
>
>
> at
> org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
>
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
>
>
> at
> org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
>
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
>
> at
> org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
>
>
> at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
>
> at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
>
> at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
>
> at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>
> at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>
> at org.mortbay.jetty.Server.handle(Server.java:326)
>
> at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
>
> at
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:939)
>
>
> at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
>
> at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
>
> at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
>
> at
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>
>
> at
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
>
>
> Caused by: org.eclipse.birt.core.exception.CoreException: There are
> errors evaluating script "
>
>
> // ---IMPORT PACKAGES
> //importPackage(Packages.java.sql);
> importPackage(Packages.com.myServer.research.Portfolio);
> //importPackage(Packages.com.microsoft.sqlserver.jdbc);
> //importPackage(Packages.java.io);
> //System.out.println("================================");
>
> // ---IMPORT PACKAGES
>
> // --- DEFINE THE STRATEGY PROGRAM IDS
> var ProgID_StatisticalArbitrage = "2456, 3456";
> // --- DEFINE THE STRATEGY PROGRAM IDS
>
> // --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
> var jj = new Portfolio(ProgID_StatisticalArbitrage);
> jj.makeEqualWeigthPortfolio();
> //var pp = jj.resultVector.get(0);
> jj.showResultVector;
> //for(int i=0, i<pp.size,i++){
> //print(pp.get(i));
> //}
> //print(jj.resultVector.get(1));
> // --- INSTANTIATE THE PORTFOLIO OBJECTS FOR DIFFERENT CATEGORIES
>
>
> // --- CALCULATE THE PORTFOLIO MONTHLY RETURNS
>
> // --- CALCULATE THE PORTFOLIO MONTHLY RETURNS
>
> ":
> Wrapped java.lang.NullPointerException
> (/report/method[@name="initialize"]#23)
>
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:295)
>
>
> at
> org.eclipse.birt.core.script.ScriptContext.evaluate(ScriptContext.java:154)
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:781)
>
>
> at
> org.eclipse.birt.report.engine.executor.ExecutionContext.evaluate(ExecutionContext.java:710)
>
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScriptInternal(ScriptExecutor.java:117)
>
>
> at
> org.eclipse.birt.report.engine.script.internal.ScriptExecutor.handleScript(ScriptExecutor.java:104)
>
>
> at
> org.eclipse.birt.report.engine.script.internal.ReportScriptExecutor.handleInitialize(ReportScriptExecutor.java:84)
>
>
> ... 53 more
>
> Caused by: org.mozilla.javascript.WrappedException: Wrapped
> java.lang.NullPointerException (/report/method[@name="initialize"]#23)
>
> at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1773)
>
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
>
> at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:247)
>
> at
> org.mozilla.javascript.optimizer.OptRuntime.callProp0(OptRuntime.java:119)
>
> at org.mozilla.javascript.gen.c7._c0(/report/method[@name="initialize"]:23)
>
> at org.mozilla.javascript.gen.c7.call(/report/method[@name="initialize"])
>
> at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:398)
>
> at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3065)
>
> at org.mozilla.javascript.gen.c7.call(/report/method[@name="initialize"])
>
> at org.mozilla.javascript.gen.c7.exec(/report/method[@name="initialize"])
>
> at
> org.eclipse.birt.report.engine.javascript.JavascriptEngine.evaluate(JavascriptEngine.java:290)
>
>
> ... 59 more
>
> Caused by: java.lang.NullPointerException
>
> at
> com.myServer.research.Portfolio.Portfolio.makeEqualWeigthPortfolio(Portfolio.java:81)
>
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>
> at java.lang.reflect.Method.invoke(Unknown Source)
>
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
>
> ... 68 more
>
>
>
>
> Thanks for your help. Edgar
>
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #842114 is a reply to message #841631] Thu, 12 April 2012 02:17 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

Yes, it looks like I have the jdbc driver in more than one place.
Here is the listing of the folders where I see the driver:
1) C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu
2) C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.1.v20110905\drivers
3) C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.2.v20120213\drivers
4) C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.viewer_3.7.2.v20120213\birt\WEB-INF\lib
5) C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.viewer_3.7.2.v20120213\META-INF\lib

Should I delete any of these references?

I also designed a really simple report that connects to the database via BIRT RCP to the same database and retrieves some data. That works just fine!! No glitch whatsoever.
However, when I try to connect to the DB using the a java class that I import via the importPackage command, I get this error. For a moment, I was thinking that it may be a NetBeans issue where jdbc driver is not path and as such the driver is invisible. But the class (.jar) executes just fine in MatLab and in the console dos window and retrieves the data without a glitch.


Thanks,
Andrew

[Updated on: Thu, 12 April 2012 05:06]

Report message to a moderator

Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #842729 is a reply to message #842114] Thu, 12 April 2012 15:14 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Why would you have two versions of the same drivers directory in your
install?
2)
C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.1.v20110905\drivers
3)
C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.2.v20120213\drivers


Jason


On 4/11/2012 10:17 PM, andrew smith wrote:
> Jason,
> Yes, it looks like I have the jdbc driver in more than one place. Here
> is the listing of the folders where I see the driver:
> 1) C:\Program Files\Microsoft SQL Server JDBC Driver 3.0\sqljdbc_3.0\enu
> 2)
> C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.1.v20110905\drivers
>
> 3)
> C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.data.oda.jdbc_3.7.2.v20120213\drivers
>
> 4)
> C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.viewer_3.7.2.v20120213\birt\WEB-INF\lib
>
> 5)
> C:\Eclipse_Indigo\plugins\org.eclipse.birt.report.viewer_3.7.2.v20120213\META-INF\lib
>
>
> Should I delete any of these references?
> Thanks, Andrew
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #843196 is a reply to message #842729] Thu, 12 April 2012 21:10 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

That is a great question!! My answer is: I do not know.

I was wondering myselft about that.
Originally, I was using eclipse Helios, then I upgraded to Indigo. I deleted Helios, but saved its workspace, and then installed the Indigo. Then I imported Helios workspace. Maybe that is why there are redundancies in the directories. Do you suggest I delete one?

Thank you,
Andrew

[Updated on: Thu, 12 April 2012 21:13]

Report message to a moderator

Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #843973 is a reply to message #843196] Fri, 13 April 2012 14:57 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Andrew,

You may want to try downloading the allinone to a separate location and
give that a try. As a test I created a workspace with two projects.
One was a java project that I use to connect to a mysql db and get the
results from a table. The second was a BIRT Report Project that called
the class in the java project. To get the report to see the java
project I used the Window->preferences->Report Design->Classpath
setting. I clicked on the Configure Project Specific Settings and then
clicked on my Birt project. I added the Java project and then I added
an external jar (mysql db jar). And it worked for me.

Jason

On 4/12/2012 5:10 PM, andrew smith wrote:
> Jason,
> That is a great question!! My answer is: I do not know.
> I was wondering myselft about that. Originally, I was using eclipse
> Helios, then I upgraded to Indigo. I deleted Helios, but saved its
> workspace, and then installed the Indigo. Then I imported Helios
> workspace. Maybe that is why there are redundancies in the directories.
> Do you suggest I delete one?
> Edgar
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #847084 is a reply to message #843973] Tue, 17 April 2012 01:46 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

Thanks for your attention to my problem. Yes, I downloaded the allinone and ran the report from there. The result is pretty much the same in the long run. Here is new observation that I was able to make - this only started to happen after I ran the report through the fresh allinone bundle. The same effect persists in old version of birt and the new allinone.

The report now can execute as expected,....but only if a freshly loaded BIRT is used. In other words: I would have to shut down eclipse and re-load eclipse/birt, then the report will get generated fine. If however, I try to have birt generate report anew in the same instance of BIRT, then the old error persists.

This leads me to a question:
--Do you think BIRT is holding the instance of the JDBC driver resource open and as such when the next request comes it, the JDBC resource is unavailable since it is held up open?

Let me know if you have ran across this error in the past,

Thank you,
Andrew


update (few hours later...)

Jason,
As a follow up to the above, I decided to go ahead and connect to the database directly from BIRT via the following code:

//=====================================
importPackage(Packages.java.util);
importPackage(Packages.java.sql);
importPackage(Packages.java.lang);
importPackage(Packages.java.text);

connection = DriverManager.getConnection("jdbc:sqlserver://one.myDB.com; databaseName=orange; integratedSecurity=true;");

But the above line makes BIRT generate the following error.
Error evaluating Javascript expression. Script engine error: Wrapped java.sql.SQLException: No suitable driver found for jdbc:sqlserver://one.myDB.com; databaseName=orange; integratedSecurity=true; (/report/data-sets/script-data-set[@id="329"]/method[@name="fetch"]#9)

Just thought I'd let you know about that too as well.

thanks,
Andrew




[Updated on: Tue, 17 April 2012 06:04]

Report message to a moderator

Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #847705 is a reply to message #847084] Tue, 17 April 2012 15:12 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

I ran mine multiple times with no issues. Here is my code:

public class MySqlClassic
{
public static PreparedStatement stmt=null;
public static Connection con=null;

public Vector init() throws Exception {
Class.forName("com.mysql.jdbc.Driver").newInstance();
con =
DriverManager.getConnection("jdbc:mysql://localhost/mydb?user=root&password=root");
String sql = "SELECT * From orderdetails";
stmt = con.prepareStatement(sql);

Vector rtn = new Vector();
Statement s = null;
try {
s = con.createStatement();
} catch (SQLException se) {
System.out.println("We got an exception while creating a
statement:" +
"that probably means we're no longer
connected.");
se.printStackTrace();
System.exit(1);
}
ResultSet rs = null;
try {
rs = s.executeQuery("SELECT * FROM orderdetails");
} catch (SQLException se) {
System.out.println("We got an exception while executing our
query:" +
"that probably means our SQL is invalid");
se.printStackTrace();
System.exit(1);
}

int index = 0;

try {
while (rs.next()) {
System.out.println("Here's the result of row " + index++
+ ":");
System.out.println(rs.getString(1));
rtn.add(rs.getString(1));
}
} catch (SQLException se) {
System.out.println("We got an exception while getting a
result:this " +
"shouldn't happen: we've done something
really bad.");
se.printStackTrace();
System.exit(1);
}
return rtn;

}
public void close(){
try{
stmt.close();
con.close();
}catch( Exception e){
e.printStackTrace();
}
}
public static void main(String[] args) throws Exception {
MySqlClassic ms = new MySqlClassic();

Vector r = ms.init();
System.out.println(r.size() );

ms.close();

}
}

Then in the report
Here is my code for the scripted dataset:

//open
importPackage(Packages.test.my.sql);
mySql = new MySqlClassic();
myVec = mySql.init();
i=0;

//fetch
if( i < myVec.size() ){
row["col1"] = myVec.get(i);
i++
return true;
}else{
return false;
}

//close
mySql.close();

Jason

On 4/16/2012 9:46 PM, andrew smith wrote:
> Jason,
> Thanks for your attention to my problem. Yes, I downloaded the allinone
> and ran the report from there. The result is pretty much the same in the
> long run. Here is new observation that I was able to make - this only
> started to happen after I ran the report through the fresh allinone
> bundle. The same effect persists in old version of birt and the new
> allinone.
> The report now can execute as expected,....but only if a freshly loaded
> BIRT is used. In other words: I would have to shut down eclipse and
> re-load eclipse/birt, then the report will get generated fine. If
> however, I try to have birt generate report anew in the same instance of
> BIRT, then the old error persists.
> This leads me to a question:
> --Do you think BIRT is holding the instance of the JDBC driver resource
> open and as such when the next request comes it, the JDBC resource is
> unavailable since it is held up open?
> Let me know if you have ran across this error in the past,
>
> Thank you,
> Andrew
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #854569 is a reply to message #847705] Tue, 24 April 2012 04:08 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

Many thanks for the snippet of code and my apologies for the delayed answer. I tried your code on my machine(changed mysql to mssql-server settings and sql strings). Outside of BIRT it works just fine, and when I run it through the BIRT as suggested, I get the same error: 'No suitable driver found.'.

So what I did, I wiped out eclipse and birt and reinstalled the bundle anew. Unfortunately, still the same error. Do you think it may have something to do with an network authenticated login that I am using (integratedSecurity=true;)?
I simply ran out of things to think of as far as what could be wrong...

Thanks,
Andrew.
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #855146 is a reply to message #854569] Tue, 24 April 2012 15:03 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Andrew

I am certain why this is happening. Are you using the jtds driver?
Take a look at these:
http://www.eclipse.org/forums/index.php/mv/msg/159239/#msg_502960
and
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297956

Jason


On 4/24/2012 12:08 AM, andrew smith wrote:
> Jason,
> Many thanks for the snippet of code and my apologies for the delayed
> answer. I tried your code on my machine(changed mysql to mssql-server
> settings and sql strings). Outside of BIRT it works just fine, and when
> I run it through the BIRT as suggested, I get the same error: 'No
> suitable driver found.'.
> So what I did, I wiped out eclipse and birt and reinstalled the bundle
> anew. Unfortunately, still the same error. Do you think it may have
> something to do with an network authenticated login that I am using
> (integratedSecurity=true;)? I simply ran out of things to think of as
> far as what could be wrong...
>
> Thanks,
> Andrew.
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #856647 is a reply to message #855146] Wed, 25 April 2012 21:39 Go to previous messageGo to next message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,
Thanks for links. I am not using jtds driver. I am using plain old MSSQL Driver (sqljdbc4.jar). Since it pretty much the lasest version, I do not think I need to use any classloaders [Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver")] since everything loads automatically per my understanding per recent pubs on the driver.
Here is my code that I am using: It is as simple as one can get - pretty much textbook solution. The code should work so long as one udpates MSSQL server address, etc...

package com.andrew.jdbc;

import java.sql.*;
import com.microsoft.sqlserver.jdbc.SQLServerDriver;
import java.util.logging.Level;
import java.util.logging.Logger;

public class DbServer {

/*------------------------------------------------------------------*/
// VARIABLES
/*------------------------------------------------------------------*/
private String serverAddress = new String();
private String databaseName = new String();
private String integratedSecurity = new String();
private Statement statement = null; //Statement is an interface
private Connection conn = null; //Connection is an interface
private ResultSet resultSet = null;//ResultSet is an interface
private String connString = new String(); //connection string for the JDBC
private String sqlQuery = new String(); // for the sqlString

/*------------------------------------------------------------------*/
// CONSTRUCTORS
/*------------------------------------------------------------------*/
public DbServer() {
serverAddress = null;
databaseName = null;
integratedSecurity = null;
}
/*------------------------------------------------------------------*/
// GETTERS
/*------------------------------------------------------------------*/

public String getSqlQuery() {
return (this.sqlQuery);
}

public Statement getStatement() {
return (this.statement);
} //end .getConnection

public Connection getConnection() {
return (this.conn);
} //end .getConnection

public String getServerAddress() {
return (this.serverAddress);
}

public String getDatabaseName() {
return (this.databaseName);
}

public String getIntegratedSecurity() {
return (this.integratedSecurity);
}

public String getConnString() {
return (this.connString);
}

public ResultSet getResultSet() {
return this.resultSet;
}
/*------------------------------------------------------------------*/
// SETTTERS
/*------------------------------------------------------------------*/

public void makeResultSet() {
try {
System.out.print("Attempting to run SQL QUERY...");
this.resultSet = this.statement.executeQuery(this.sqlQuery);
System.out.print("\tSUCCESS !!!\n");
System.out.println("ResultSet Class:\t" + this.resultSet.getClass().toString());
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}
}

public void setSqlQuery(String str) {
this.sqlQuery = str;
} //end .setSqlQuery

public void setConnString(String str) {
this.connString = str;
} // end .setConnString

public void setDbSource(String defaultValue) {
int choice = this.findChoice(defaultValue);
switch (choice) {
case 0:
System.out.println("System ERROR: Unable to determine default choice...");
break;
case 1:
this.databaseName = "myDB";
this.serverAddress = "thesql.server.com";
this.integratedSecurity = "true";
break;
}// end switch



}// end .setDbSource function

/*------------------------------------------------------------------*/
// OTHER METHODS
/*------------------------------------------------------------------*/
public void conn2db() {
// try {
// Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
// } catch (ClassNotFoundException ex) {
// Logger.getLogger(DbServer.class.getName()).log(Level.SEVERE, null, ex);
// }
try {
System.out.print("Attempting to make a database CONNECTION...");

conn = DriverManager.getConnection(this.getConnString());
System.out.print("\tSUCCESS !!!\n");
System.out.println(".getCatalog: " + conn.getCatalog());
System.out.println("Connection Class:\t" + this.conn.getClass().toString());
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}
} //end .conn2db

public void initStatementObj() {
try {
System.out.print("Attempting to initialize the database STATEMENT...");
statement = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
System.out.print("\tSUCCESS !!!\n");
System.out.println("Statement Class:\t" + this.statement.getClass().toString());
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}
}//end .initStatementObj

public void showInitChoices() {
System.out.println("grapevine");
} //end .showInitChoices

public void showDbSettings() {
System.out.println("SQL Server URL Address: " + this.getServerAddress());
System.out.println("SQL Server Database Name: " + this.getDatabaseName());
System.out.println("SQL Server IntegrateSecurity: " + this.getIntegratedSecurity());
System.out.println("SQL Server ConnString: " + this.getConnString());
} // end .showDbSettings

private int findChoice(String choiceStr) {
int choice;
if (choiceStr.equalsIgnoreCase("grapevine")) {
choice = 1;
} else {
choice = 0;
}
return (choice);
} // end .findChoice

public void close() {
try {
System.out.print("Attempting to CLOSE RESULTSET...");
resultSet.close();
System.out.print("\tSUCCESS !!!\n");
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}
try {
System.out.print("Attempting to CLOSE STATEMENT...");
statement.close();
System.out.print("\tSUCCESS !!!\n");
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}
try {
System.out.print("Attempting to CLOSE CONNECTION...");
conn.close();
System.out.print("\tSUCCESS !!!\n");
} catch (SQLException e) {
System.out.print("\tFAIL !!!\n");
e.printStackTrace();
}

}
}//end CLASS

The funny thing is the birt logs onto the database fine for the first time and then keeps on on throwing the error No suitable driver found when I try to reload the report in preview window.

Thanks,
Andrew

[Updated on: Wed, 25 April 2012 21:40]

Report message to a moderator

Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #857642 is a reply to message #856647] Thu, 26 April 2012 18:33 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

Andrew

Any chance you can try the jtds driver? I believe I saw something on
authentication issues with the native driver.

Jason

On 4/25/2012 5:39 PM, andrew smith wrote:
> Jason, Thanks for links. I am not using jtds driver. I am using plain
> old MSSQL Driver (sqljdbc4.jar). Since it pretty much the lasest
> version, I do not think I need to use any classloaders
> (Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");) since
> everything loads automatically per my understanding per recent pubs on
> the driver. Here is my code that I am using: It is as simple as one can
> get - pretty much textbook solution. The code should work so long as one
> udpates MSSQL server address, etc...
>
> package com.andrew.jdbc;
>
> import java.sql.*;
> import com.microsoft.sqlserver.jdbc.SQLServerDriver; import
> java.util.logging.Level;
> import java.util.logging.Logger;
>
> public class DbServer {
>
> /*------------------------------------------------------------------*/
> // VARIABLES
> /*------------------------------------------------------------------*/
> private String serverAddress = new String();
> private String databaseName = new String();
> private String integratedSecurity = new String();
> private Statement statement = null; //Statement is an interface
> private Connection conn = null; //Connection is an interface
> private ResultSet resultSet = null;//ResultSet is an interface
> private String connString = new String(); //connection string for the JDBC
> private String sqlQuery = new String(); // for the sqlString
>
> /*------------------------------------------------------------------*/
> // CONSTRUCTORS
> /*------------------------------------------------------------------*/
> public DbServer() {
> serverAddress = null;
> databaseName = null;
> integratedSecurity = null;
> }
> /*------------------------------------------------------------------*/
> // GETTERS
> /*------------------------------------------------------------------*/
>
> public String getSqlQuery() {
> return (this.sqlQuery);
> }
>
> public Statement getStatement() {
> return (this.statement);
> } //end .getConnection
>
> public Connection getConnection() {
> return (this.conn);
> } //end .getConnection
>
> public String getServerAddress() {
> return (this.serverAddress);
> }
>
> public String getDatabaseName() {
> return (this.databaseName);
> }
>
> public String getIntegratedSecurity() {
> return (this.integratedSecurity);
> }
>
> public String getConnString() {
> return (this.connString);
> }
>
> public ResultSet getResultSet() {
> return this.resultSet;
> }
> /*------------------------------------------------------------------*/
> // SETTTERS
> /*------------------------------------------------------------------*/
>
> public void makeResultSet() {
> try {
> System.out.print("Attempting to run SQL QUERY...");
> this.resultSet = this.statement.executeQuery(this.sqlQuery);
> System.out.print("\tSUCCESS !!!\n");
> System.out.println("ResultSet Class:\t" +
> this.resultSet.getClass().toString());
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
> }
>
> public void setSqlQuery(String str) {
> this.sqlQuery = str;
> } //end .setSqlQuery
>
> public void setConnString(String str) {
> this.connString = str;
> } // end .setConnString
>
> public void setDbSource(String defaultValue) {
> int choice = this.findChoice(defaultValue);
> switch (choice) {
> case 0:
> System.out.println("System ERROR: Unable to determine default choice...");
> break;
> case 1:
> this.databaseName = "myDB";
> this.serverAddress = "thesql.server.com";
> this.integratedSecurity = "true";
> break;
> }// end switch
>
>
>
> }// end .setDbSource function
>
> /*------------------------------------------------------------------*/
> // OTHER METHODS
> /*------------------------------------------------------------------*/
> public void conn2db() {
> // try {
> // Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
> // } catch (ClassNotFoundException ex) {
> // Logger.getLogger(DbServer.class.getName()).log(Level.SEVERE, null, ex);
> // }
> try {
> System.out.print("Attempting to make a database CONNECTION...");
> conn = DriverManager.getConnection(this.getConnString());
> System.out.print("\tSUCCESS !!!\n");
> System.out.println(".getCatalog: " + conn.getCatalog());
> System.out.println("Connection Class:\t" +
> this.conn.getClass().toString());
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
> } //end .conn2db
>
> public void initStatementObj() {
> try {
> System.out.print("Attempting to initialize the database STATEMENT...");
> statement = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
> ResultSet.CONCUR_READ_ONLY);
> System.out.print("\tSUCCESS !!!\n");
> System.out.println("Statement Class:\t" +
> this.statement.getClass().toString());
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
> }//end .initStatementObj
>
> public void showInitChoices() {
> System.out.println("grapevine");
> } //end .showInitChoices
>
> public void showDbSettings() {
> System.out.println("SQL Server URL Address: " + this.getServerAddress());
> System.out.println("SQL Server Database Name: " + this.getDatabaseName());
> System.out.println("SQL Server IntegrateSecurity: " +
> this.getIntegratedSecurity());
> System.out.println("SQL Server ConnString: " + this.getConnString());
> } // end .showDbSettings
>
> private int findChoice(String choiceStr) {
> int choice;
> if (choiceStr.equalsIgnoreCase("grapevine")) {
> choice = 1;
> } else {
> choice = 0;
> }
> return (choice);
> } // end .findChoice
>
> public void close() {
> try {
> System.out.print("Attempting to CLOSE RESULTSET...");
> resultSet.close();
> System.out.print("\tSUCCESS !!!\n");
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
> try {
> System.out.print("Attempting to CLOSE STATEMENT...");
> statement.close();
> System.out.print("\tSUCCESS !!!\n");
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
> try {
> System.out.print("Attempting to CLOSE CONNECTION...");
> conn.close();
> System.out.print("\tSUCCESS !!!\n");
> } catch (SQLException e) {
> System.out.print("\tFAIL !!!\n");
> e.printStackTrace();
> }
>
> }
> }//end CLASS
>
> The funny thing is the birt logs onto the database fine for the first
> time and then keeps on on throwing the error No suitable driver found
> when I try to reload the report in preview window.
> Thanks,
> Andrew
>
Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #870405 is a reply to message #857642] Tue, 08 May 2012 04:27 Go to previous message
andrew smith is currently offline andrew smithFriend
Messages: 43
Registered: February 2012
Member
Jason,

Sorry for a delay on my end. I have been out to a vacation for a week. Yes I will try your suggestion by the end of this week.

Thanks a lot!!
Andrew
Previous Topic:BIRT 3.7.2: Unable to access the data from outer data set using row._outer<column-name>
Next Topic:Localization letters- problem with export from BIRT to PDF
Goto Forum:
  


Current Time: Thu Mar 28 08:43:18 GMT 2024

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

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

Back to the top