I am using jasper reports 4.5.1. I just included all the dependencies required for jasper-reports-4.5.1. I am getting the following exception
Could not connect to the database: No suitable driver found for CatalogNew No suitable driver found for CatalogNew.
Apr 26, 2012 1:01:51 PM net.sf.jasperreports.engine.query.JRJdbcQueryExecuter <init>
WARNING: The supplied java.sql.Connection object is null.
on executing following code.
databaseName=ReportDriver.databaseName;
userName=ReportDriver.userName;
password=ReportDriver.password;
Class.forName("net.sourceforge.jtds.jdbc.Driver");
jdbcConnection = DriverManager.getConnection(databaseName,userName,password);
I also included the database lib jtds.1.2.5 in the lib folder of IReport-4.5.1 installation.
Apparently
ReportDriver.databaseNamecontains a database name (“CatalogNew”), not a JDBC URL.But the method
DriverManager.getConnection()expects a JDBC URL.Most probably you’ll need to do something like this:
You will need to replace
localhostwith the name of the server running your SQL Server instance.For more details on the connection URL see the jTDS documentation:
http://jtds.sourceforge.net/faq.html#urlFormat