Lightning Tools Blog

SharePoint Tools, Web Parts and Discussions

DB2 and the Business Connectivity Services in SharePoint 2010

In this walkthrough we will demonstrate how to integrate a DB2 database with Microsoft SharePoint 2010 through the BCS and ODBC and display DB2 data on SharePoint 2010 page. In order to do this we will describe how to create a new external content type by using BCS Meta Man.

  1. Prerequisites:
  2. Open Visual Studio 2010
  3. Create a New Project
  4. Select the “SharePoint 2010” node, and then the “Empty SharePoint Project” project type
  5. Give your project a name i.e DB2BCSMetaManDemo and click “OK”
    Create DB2BCSMetaManDemo project 

    [Please click the images for a larger view]
  6. On the next dialog box, enter the url of where you want to deploy your model, and make sure you select “Deploy as a farm solution” , click “Finish” button
    Deploy as a farm solution
  7. Add a new item to the newly created Project, either right-click on the Project in the Solution Explorer and Navigate to Add New Item, or select the Project Item and press “Ctrl+Shift+A”
  8. Select the “Lightning Tools” node, select “BCSMetaMan” Item Type, give your model a name, such as “DepartmetModel” and click “Add”
    Add a new BCS MetaMan project item
  9. If prompted, click “Trial” on the licensing dialog
  10. To show the “BCS Meta Man Data Source Explorer” we need to enable it from the Menu item, this new window can be docked so it doesn’t get in your way
    Open the BCS MetaMan data source explorer
  11. Click the “Add Connection” button to show the “Connection Dialog”
  12. Select “ODBC Server” as Data Source type, enter DB2 ODBC connection string (for example it can be “Driver={IBM DB2 ODBC DRIVER};Database=SAMPLE;Hostname=cygnus;port=50000;Protocol=TCPIP;Uid=Administrator;Pwd=12345;Trusted_Connection=false;”), enter double quotes as left and right delimiters and “?” as parameter symbol and click “Connect” button
    DB2 ODBC connection string
  13. The Data Source Explorer will now be populated with your DB2 data
    See the tables and views available to use
  14. We will be working with the ADMINISTRATOR.”DEPARTMENT” table, to add it to the Model , just drag it from the “Data Source Explorer” onto the “Diagram”
  15. When you drop the table you will be shown the following dialog, we should choose “Database , click “OK”
    Choose the model type "Database"
  16. Accept the default entity name by clicking “Next”
    Accept the default entity name
  17. Accept the default “Identifiers” by clicking “Next”
    Accept the Identifiers selected
  18. Accept the default 3 methods to be created, click “Generate” (The default 3 methods are: “Finder” – Returns all items, “Specific Finder” – Returns a single item by identifier, “IdEnumerator” – Returns just the Identifiers for all of the items )
    Accept the methods
  19. Press F5 to deploy, this will load up your SharePoint Page once deployed
  20. Add a new External list by selection on SharePoint page “Site Action”->“More Options”->“External List”
    Add a new External List
  21. Click on the icon to show the available External Content Types
    Select the External Content Type
  22. Select our DB2BCSMetaManDemo.ADMINISTRATOR_DEPARTMENT External Content Type, click “OK”
    Select the the Department External Content Type
  23. Click “Create”
  24. Your External System data from DB2 database is now displayed in the SharePoint External List
    External Data from DB2 is now shown within SharePoint 2010

We hope this walkthrough will be useful for you. If you have any questions feel free to email them to support@lightningtools.com

Click here to get an email when we update our blog

Print | posted on Wednesday, July 21, 2010 2:58 PM

Feedback

No comments posted yet.
Title  
Name
Email (never displayed)
Url
Comments   
Please add 6 and 6 and type the answer here: