Home » Eclipse Projects » 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 19:24  |
andrew smith 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 19:57] Report message to a moderator
|
|
| | |
| Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #841631 is a reply to message #841085] |
Wed, 11 April 2012 11:15   |
Jason Weathersby 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
>
Jason Weathersby
BIRT Exchange
|
|
|
| Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #842114 is a reply to message #841631] |
Wed, 11 April 2012 22:17   |
andrew smith 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 01:06] Report message to a moderator
|
|
| |
| Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #843196 is a reply to message #842729] |
Thu, 12 April 2012 17:10   |
andrew smith 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 17:13] Report message to a moderator
|
|
| |
| Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #847084 is a reply to message #843973] |
Mon, 16 April 2012 21:46   |
andrew smith 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 02: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 11:12   |
Jason Weathersby 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
Jason Weathersby
BIRT Exchange
|
|
| | |
| Re: BIRT and MSSQL: No suitable driver found for jdbc: [message #856647 is a reply to message #855146] |
Wed, 25 April 2012 17:39   |
andrew smith 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 17:40] Report message to a moderator
|
|
| | |
Goto Forum:
Current Time: Mon May 20 17:19:23 EDT 2013
Powered by FUDForum. Page generated in 0.02218 seconds
|