Create JDBC Data Adapter
To generate reports from a database, we need to create a Data Adapter. In this tutorial, we will verify how to create a JDBC data adapter.
What is a Data Adapter?
A Data Adapter allows Jaspersoft Studio to obtain data from a Data Source. JDBC (Java Database Connectivity) is a standard Java API for connecting to relational databases.
Steps to Create
- Open Data Adapter Wizard: In the Repository Explorer, right-click on "Data Adapters" and select "Create Data Adapter".
- Select Type: Choose "Database JDBC Connection" and click Next.
- Configure Connection:
- Name: Give a descriptive name.
- JDBC Driver: Select your database driver (e.g., MySQL Driver, PostgreSQL Driver).
- JDBC Url: Enter the connection string (e.g., `jdbc:mysql://localhost:3306/mydb`).
- Username: Your database username.
- Password: Your database password.
- Test and Save: Click "Test" to verify the connection. If successful, click "Finish".
Using the Adapter
Once created, you can use this adapter in your reports to run SQL queries and populate fields.