You are on page 1of 16

2010

BIRT Connection
Profiles
Fed up creating new data sources each time you create a new BIRT report, or simply too
lazy to remember the connection strings every time? This guide shows you how to set up
any number of pre-defined connection strings that you can call upon at any time in BIRT
Designer.

Paul Bappoo
Paul@BirtReporting.com
http://www.BirtReporting.com

February 2010
BIRT – Connection Profiles

CONTENTS

How To Contact The Author .......................................................................................................................... 4

Connection Profiles ...................................................................................................................................... 5

Setting up a connection profile ................................................................................................................. 6

Using the Data Source............................................................................................................................. 10

Conclusion .............................................................................................................................................. 15

More Information ....................................................................................................................................... 16

Page | 2
BIRT – Connection Profiles

Paul Bappoo – BIRT Connection Profiles

© COPYRIGHT 2009 by Paul Bappoo, all rights reserved.

This guide is furnished under license and may be used or copied only in accordance with the terms of such license. The content of this guide
is furnished for informational use only, is subject to change without notice, and should not be construed as a commitment by the author. The
author assumes no responsibility or liability for any errors or inaccuracies that may appear in this guide.

Except as permitted by such license, no part of this publication may be reproduced, stored in a retrieval system or transmitted, in any form or
by any means, electronic, mechanical, recording or otherwise, without the prior written permission of the author.
All product and company names are trademarks or registered trademarks of their respective holders.

Page | 3
BIRT – Connection Profiles

HOW TO CONTACT THE AUTHOR

Email: Paul@BirtReporting.com

Web Site: http://www.BirtReporting.com

Paul Bappoo has been an international technical software consultant and involved with computers for over
30 years and has an interest in BIRT reporting, enterprise application integration, automated software
testing, computer based training and enterprise system implementation. He would be delighted to hear from
you with your tips, tricks and stories about your usage of BIRT. If you have a great tip to share with the
community drop him a line.

Page | 4
BIRT – Connection Profiles

CONNECTION PROFILES

OK hands up if you have a rubbish memory like me! OK there are a number of things I can remember, like
my wifes birthday, our wedding anniversary and other such things that are essential to survival but there are
certain things that I simply can’t (or maybe don’t want to) keep in my head.

One example of this is the JDBC connection string for SQL Server databases that I use within my BIRT data
sources. You know the thing that looks like this:

jdbc:jtds:sqlserver://server[:port][/database];

I can remember the server name (usually) and for some strange reason (although I hate to admit it) I can
remember that SQL Server lives on port 1433 and I can also sometimes remember the name of the database
that I want to connect to. What I seem dismally unable to remember is the structure of the connection
string itself.

Ultimately this means that every time I create a new BIRT report I have to create a new data source and
lookup the connection string from one of my own texts on the subject. This makes me feel rather silly and so
I eventually resorted to keeping a text file on the desktop of my BIRT machine, containing just the
connection string! This way I can easily access the connection string and copy it into my report.

Well, I have found a better way! It’s called Connection Profiles and it allows you to store away connections
to all your databases, including the login credentials, in a central location that can be accessed directly from
within the BIRT designer whenever you need them.

Page | 5
BIRT – Connection Profiles

SETTING UP A CONNECTION PROFILE

In the BIRT designer, open the Window menu, select Show View and Other. Then from the dialogue that
appears, expand the Data Management section and highlight the Data Source Explorer item, then press OK.

Page | 6
BIRT – Connection Profiles

You will see that the Data Source Explorer tab and it’s contents appears in the lower pane of the designer
window.

Page | 7
BIRT – Connection Profiles

To create a data source, select the appropriate data source type, in this example I am going to create a SQL
Server source, so I highlight JDBC Data Source, right click and select New...

Page | 8
BIRT – Connection Profiles

I name the data source and give it a description, then click next. Now we are in familiar territory, looking at
the standard data source creation screen. If you are not familiar with this please refer to my guide “The
complete getting started guide to BIRT Reporting” where you will find a full description of how to create a
data source. As a quick reminder, here is the completed screen.

The test connection button tells me that I have entered the correct information. On clicking finish I see that
my SQL Server connection is saved to the Data Source Explorer.

Page | 9
BIRT – Connection Profiles

USING THE DATA SOURC E

Now when I want to create a data source it is simplicity itself, with no remembering to do!

All I have to do is right click on the Data Sources item in the Data Explorer pane and select New Data Source

And in the next screen select the radio button called “Create from a connection profile in the profile store”
and click next.

Page | 10
BIRT – Connection Profiles

Now I just browse to my profile store, which by default is saved in a sub folder of the BIRT workspace. When
I installed BIRT I made my workspace C:\BIRT, so the full path to my profile is:

C:\BIRT\.metadata\.plugins\org.eclipse.datatools.connectivty\

Page | 11
BIRT – Connection Profiles

Once I have browsed to here I select the ServerProfiles.dat file

Page | 12
BIRT – Connection Profiles

BIRT opens up the data profiles store and shows me all the profiles I have previously created.

Page | 13
BIRT – Connection Profiles

So now all I have to do is select the one I want to use, in my example “My local SQL server” and on clicking
next I see the data source screen pre-filled with my data connection details!

Page | 14
BIRT – Connection Profiles

Click finish and that’s it, a few easy steps to adding my saved data source to my new BIRT report.

CONCLUSION

If you have a number of different databases that you report on regularly then creating connection profiles
makes the task of setting up data sources that much easier. Give it a try and let me know how you get on
and what you think of this tip.

Page | 15
BIRT – Connection Profiles

MORE INFORMATION

If you would like to find out more about BIRT reporting and the BIRT User Group UK then please
visit

http://www.BIRTReporting.com

Please feel free to share this address with your colleagues and inspire them to use BIRT to create
great looking reports.

I look forward to your feedback so please feel free to send me an email and let me know how you
get on with BIRT, provide feedback on this guide, share your tips and tricks, or request help for
specific problems. I can’t guarantee to personally solve everyone’s problems but there are some
great BIRT related forums out there and you can find a growing list of links and resources on my
site.

Paul Bappoo

Paul@BirtReporting.com

http://www.BIRTReporting.com

Page | 16

You might also like