Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your developerWorks profile is displayed to the public, but you may edit the information at any time. Your first name, last name (unless you choose to hide them), and display name will accompany the content that you post.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

Invoking Web services from SQL

Integrating relational data with Web services using DB2

Tim Brown, DB2 Universal Database Solutions Expert, IBM
Tim Brown is certified as a DB2 Universal Database Solutions Expert and is part of IBM Software Group Services. He has been with IBM for 6 years and currently works with a small team of DB2 experts who provide technical consultants services to customers across many industries in the UK and across Europe. Tim's expertise covers problem determination, problem correction, database administration, database design, database application development, database replication and skills transfer. More recently Tim has spent his time working with DB2's Web services functionality and has written a document which looks at how to implement and use all the Web services functionality provided with DB2.
James Magowan, Web Services and Data Grids, IBM
James Magowan has spent 7 years with IBM working on leading edge customer facing projects. He has worked in High Performance Computing with large SP installations before playing with Linux clusters ahead of IBM's Linux strategy. He has recently worked on Grid Computing Projects since January 2001 including European DataGrid and OGSA-DAI (Open Grid Services Architecture - Database Access and Integration) and was heavily involved within the Global Grid Forum chairing two working groups. These Grid projects have given him experience with Service Orientated Architectures and Data Grids. He has been working with Web Services and Data Grids for the last 3 years.

Summary:  Developing applications that access both Web services and database management systems can be an overwhelming task. It doesn't need to be. This tutorial demonstrates how to generate DB2 user-defined functions (UDFs) that provide access to Web services. The generated UDFs can be used in SQL statements to combine relational data with dynamic data retrieved from a Web service. Several different examples are provided.

Date:  09 Jan 2003
Level:  Intermediate PDF:  A4 and Letter (297 KB | 32 pages)Get Adobe® Reader®

Activity:  5731 views
Comments:  

Before you start

About this tutorial

Web services provide access to distributed applications. They are increasingly used to integrate information processing within and between enterprises. When building service-based applications, Web services often need to be integrated with relational data. To accomplish this, applications must access both Web services and database management systems.

The Web services consumer converts existing WSDL interfaces into DB2® table or scalar functions. Web service consumer User Defined Functions (UDFs) can enable databases to directly invoke Web services using SQL. By using SQL to access Web Services data, you save effort because you can manipulate the data within the context of an SQL statement.

You might think using these Web service consumer UDFs in SQL statements could be time consuming or require advanced programming skills. This tutorial will show you otherwise. It will guide you through the steps to:

  • Enable your database for Web Service consumer UDFs
  • Create Web service consumer UDFs using WebSphere® Studio Application Developer wizard
  • Create Web service consumer UDFs using the DB2 command line

After generating and deploying the UDFs, they can be used by application programs to combine relational data with dynamic data retrieved from the Web service.

Examples are given to show how to use the UDFs in SQL statements. This tutorial assumes basic knowledge of Web services, DB2 SQL, and WebSphere Studio Application Developer V5.1.1. If you are not familiar with Web services, or you could use a refresher, developerWorkshas an excellent introductory tutorial on Web services (see Resources ).


Prerequisites

To complete the steps in this tutorial, you'll need the following software installed and running:

  • DB2 Universal Database V8.1 FixPack 4
  • WebSphere Studio Application Developer V5.1.1. This is optional - you can use the DB2 command line but Application Developer makes it much easier.

A free trial version DB2 Universal Database® V8.1 is available from the developerWorks download page.

This tutorial has been revised from one originally created by Marcus Schneider and Dan Wolfson (IBM Distinguished Engineer).


Notices and trademarks

Copyright, 2003 International Business Machines Corporation. All rights reserved.

IBM, DB2, DB2 Universal Database, DB2 Information Integrator, WebSphere and WebSphere MQ are trademarks or registered trademarks of IBM Corporation in the United States, other countries, or both.

Other company, product, and service names may be trademarks or service marks of others.

1 of 9 | Next

Comments



Help: Update or add to My dW interests

What's this?

This little timesaver lets you update your My developerWorks profile with just one click! The general subject of this content (AIX and UNIX, Information Management, Lotus, Rational, Tivoli, WebSphere, Java, Linux, Open source, SOA and Web services, Web development, or XML) will be added to the interests section of your profile, if it's not there already. You only need to be logged in to My developerWorks.

And what's the point of adding your interests to your profile? That's how you find other users with the same interests as yours, and see what they're reading and contributing to the community. Your interests also help us recommend relevant developerWorks content to you.

View your My developerWorks profile

Return from help

Help: Remove from My dW interests

What's this?

Removing this interest does not alter your profile, but rather removes this piece of content from a list of all content for which you've indicated interest. In a future enhancement to My developerWorks, you'll be able to see a record of that content.

View your My developerWorks profile

Return from help

static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Information Management
ArticleID=139797
TutorialTitle=Invoking Web services from SQL
publish-date=01092003
author1-email=
author1-email-cc=
author2-email=
author2-email-cc=

Tags

Help
Use the search field to find all types of content in My developerWorks with that tag.

Use the slider bar to see more or fewer tags.

Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere).

My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Use the search field to find all types of content in My developerWorks with that tag. Popular tags shows the top tags for this particular content zone (for example, Java technology, Linux, WebSphere). My tags shows your tags for this particular content zone (for example, Java technology, Linux, WebSphere).

Try IBM PureSystems. No charge.