Creating a New Data Adapter Activity

 

 

 

Step

Action

1. 

Activity End Result

 

 

By the end of this activity, you define a new data adapter for the Foodmart database with the values displayed above.

 

To achieve this, you use the Data Adapter Wizard.

2. 

Note: Make sure that

 

1. The Repository Navigator view is active

2. The Data Adapters node is expanded

 

The Data Adapters  lists two data adapters which ship with Jaspersoft Studio:

- One Empty Record: useful for testing report layouts

- Sample DB: used in community tutorials

3. 

Note: The business requirement is to create a data adapter for the Foodmart database.

 

This relational database provides the operational history of a fictitious enterprise. The Foodmart database is included with the JasperReports Server sample data.

4. 

Begin by right-clicking the Data Adapters node.

5. 

Click the Create DataAdapter menu item.

6. 

Note: The Data Adapter Wizard window appears.

 

 

The Data Adapters page is active.

7. 

Foodmart is a relational database.

 

Click the Database JDBC Connection list item.

8. 

Click the Next button.

9. 

Note: The Data Adapter page of the wizard appears.

 

 

Next, provide the appropriate field values.

10. 

Enter Foodmart into the Name: field.

11. 

Specify the JDBC Driver to access the Foodmart database.

 

Click the JDBC Driver pulldown.

12. 

Note: The JDBC Driver pulldown lists JDBC drivers for database types.

 

Foodmart is a PostgreSQL database.

13. 

As needed, use the scrollbar to locate the appropriate driver.

Click the PostgreSQL (org.postgresql.Driver) list item.

14. 

Note: The JDBC Url field displays the default URL.

 

 

The URL syntax specifies:

 

host: localhost

port number:  5432

database name: database

15. 

Edit the database name to be foodmart

 

Click in the JDBC Url field.

16. 

Enter a valid value e.g. postgres into theĀ  Username field.

17. 

Enter a valid value e.g. postgres into theĀ  Password field.

18. 

Next, test the connection as specified.

 

Click the Test button.

19. 

Note: The Test window appears.

 

 

The message indicates whether or not the test is successful.

20. 

In the Test window, click the OK button.

21. 

Note: If the test is not successful, make sure to check the field values and try again.

22. 

In the DataAdapter Wizard window, click the Finish button.

23. 

Note: The Foodmart data adapter appears under the Data Adapters node in the Repository Navigator.

24. 

Congratulations!

 

In this activity you created and tested a data adapter for the Foodmart database.

End of Procedure.