I am assuming that you actually have Firebird installed and your Firebird is running as a service. The user account running the Firebird service does not have access to your user profile and therefor is unable to open a database file in C:\Users\waqas\Desktop\MOBILESTORE.fdb
. Put the file in a location that is accessible to all users (or specifically to the user linked to the Firebird service), say C:\Databases\
.
That said, I would actually expect this scenario to result in an error almost immediately, so it might be a different problem.
EDIT
You indicate in the comments, that you receive a java.lang.ClassNotFoundException: org.firebirdsql.jdbc.FBDriver
. This means that you did not add the Jaybird JDBC driver to the classpath of iReport.
You can download the Jaybird (Firebird JDBC) driver from http://www.firebirdsql.org/en/jdbc-driver/
I don't use iReport myself, but according to this tutorial you can add the driver under Tools > Options > iReport, tab Classpath. You need to add jaybird-full-2.2.3.jar
, OR jaybird-2.2.3.jar
and connector-api-1.5.jar
(from the lib folder in the Jaybird zip).
EDIT 2
I have just downloaded iReport and tried it myself. There are basically two ways of making a database connection to Firebird from iReport, both work for me:
Database JDBC connection
The first option is Database JDBC connection, this requires the driver to be on the classpath:
- Go to Tools, Options, iReport, Classpath and add
jaybird-full-2.2.3.jar
- Click on the create datasource icon on the welcome tab
- Select Database JDBC connection and click Next
- Give the datasource a name
- For JDBC driver enter
org.firebirdsql.jdbc.FBDriver
- For URL enter the JDBC url for your database (eg
jdbc:firebirdsql://localhost/D:/data/db/employee.fdb
) - Enter username and password
A click on test should show "Connection test successful!". Now you can use the database connection.
NetBeans Database JDBC connection
The other method of connecting is NetBeans Database JDBC connection
- Go to Window, Services
- Expand the Databases service
- Right click on Drivers, New Driver
- Under Driver file(s) add
jaybird-full-2.2.3.jar
- Driver Class and Name are filled in automatically; click OK
- Right click the new Firebird (JCA/JDBC driver) entry and select Connect using
- Enter username and password, and the JDBC url, click ok
- Click the create datasource icon
- Select NetBeans Database JDBC connection
- Enter a name and select the connection from the dropdown