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]

Set up an SQL realm with DB2 Express-C, Eclipse WTP, and WebSphere Application Server Community Edition V1.1

Implementing database security with Java kick-start

Krishnakumar Balachandar (krishnakumarb@in.ibm.com), Software Engineer, WebSphere Application Server Community Edition Support Team, IBM
Krishnakumar Balachandar is a Senior Staff Software Engineer at IBM Software Labs in Bangalore, India. He is part of the support team for Geronimo and WebSphere Community Edition.

Summary:  This tutorial shows you how to set up an SQL realm to implement database security for a Web application using the no-charge Java™ kick-start package.

Date:  20 Sep 2006
Level:  Intermediate PDF:  A4 and Letter (2027 KB | 33 pages)Get Adobe® Reader®

Activity:  8383 views
Comments:  

Before you start

When implementing security in a Web application, a JAAS module is required to specifically handle user authentication and authorization. WebSphere® Application Server Community Edition provides a SQL realm that can connect to a database for obtaining user credentials. In this tutorial, you will see how to set up tables for creating an SQL realm in DB2® Express-C, how to set up a development environment using the Eclipse Web Tooling Platform to create a Web application, and how to deploy the Web application to WebSphere Application Server Community Edition from Eclipse.

All Web applications should employ some level of security for user authentication and authorization to verify a user’s identity and enable access to application functions that are applicable to the user's role.

Web applications can use LDAP, database, file system, Kerberos, or other such systems to provide authentication and authorization. To access security data from the selected method or system, an SQL realm is set up by creating tables in a database and configuring a Java Authentication and Authorization Service (JAAS) module to access these tables from an application server.

Figure 1 shows different components in WebSphere Application Server Community Edition (hereafter referred to as Community Edition) used to provide an SQL realm. The Web application uses an SQL realm that connects to the database using a pool or driver. The user credentials are stored in tables in the database and are fetched when calls are made using the JAAS SQL realm.


Figure 1. Components of an SQL realm
Figure 1. Components of an SQL realm
Java Authentication and Authorization Service (JAAS) is a set of APIs that enables Java applications to access authentication and access control services without being tied to the service it is using. Using JAAS, the Java application can plug into security mechanisms like LDAP, Kerberos, databases, and so on, providing a layer between our application and the security mechanism being used.

Setting up a database realm

Setting up a database realm involves performing these general steps:

  • Create tables for users and groups in DB2 Express-C.
  • Deploy a database pool in Community Edition, if the realm is going to use a pool to connect to the database.
  • Deploy the SQL realm plan in Community Edition.
  • Configure and deploy the Web application that uses the SQL realm.

The remainder of this tutorial explains these tasks in detail.

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=WebSphere, Information Management, Java technology, Open source
ArticleID=160154
TutorialTitle=Set up an SQL realm with DB2 Express-C, Eclipse WTP, and WebSphere Application Server Community Edition V1.1
publish-date=09202006
author1-email=krishnakumarb@in.ibm.com
author1-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.