Search WebSpherePower's 6,973 WebSphere, Java, and Eclipse article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
Locate your JDBC DataSource in WebSphere Application Server using JNDI (continued)

The only problem with this method is that in order to refer to your DataSource by an alias name, you have to define the alias. You do that when you set up your Web application, and the easiest way to perform this task is through WebSphere Studio Application Developer.

If you open your Web application project in WebSphere Studio Application Developer, you can bring up the Deployment Descriptor in edit mode by double clicking on the Deployment Descriptor entry in the project tree. Using the tabs at the bottom of the Deployment Descriptor edit pane, navigate to the References panel.

On the References panel, use the tabs at the top of the screen to bring up the Resources section that you see in Figure A.

FIGURE A


Use WebSphere Studio Application Developer to create your DataSource alias. Roll over picture for a larger image.

Click on the Add button to create your new DataSource alias.

In the Resource References section, enter the name of your new alias. This will be the name that you'll specify in your look-up code to locate your DataSource.

In the Details section, use the Browse button to locate and select javax.sql.DataSource, then set the Authentication to Application.

In the WebSphere Extensions section, set the Connection Management to Default.

In the WebSphere Bindings section, specify the actual JNDI name of your DataSource.

When you're finished, close and save the Deployment Descriptor and you're ready to redeploy your application, or test it right in Studio using the WebSphere Test Environment.

There are obviously other values that you can use for many of these properties, but these settings will get you going. For further information on the purpose and possible values for the various settings available for a JDBC resource alias, take a look at the WebSphere Application Server Information Center at http://publib.boulder.ibm.com/infocenter/ws51help/index.jsp.

Product availability and resources
For more information on WebSphere, visit http://www-136.ibm.com/developerworks/websphere/.
David Gewirtz is the author of How To Save Jobs and Where Have All The Emails Gone? For more than 20 years, he has analyzed current, historical, and emerging issues relating to technology, competitiveness, and policy. David is the Editor-in-Chief of the ZATZ magazines, is the Cyberterrorism Advisor for the International Association for Counterterrorism and Security Professionals, and is a member of the instructional faculty at the University of California, Berkeley extension. He can be reached at david@zatz.com and you can follow him at http://www.twitter.com/DavidGewirtz.


« Previous  ·  1  ·  2  ·  3
Other articles you might like
Home > Java (6 articles)
   Use WebSphere to develop Java applications for Palm handhelds
   A simple introduction to J2EE
   Accessing remote AS/400 databases using JTOpen
Home > Database Integration (3 articles)
   Creating a MySQL data source using WebSphere Application Server
   Easily connecting to MySQL databases from WebSphere Studio
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent WebSpherePower Articles
A perfect 10: celebrating 10 years online
You can help bring security and safety back to White House email
Introducing the WebSpherePower RSS feeds
From New Jersey to Palm Bay, Florida
A WebSphere pot o' gold
How Elvis entered the building and CES went out the window
WebSphere Application Server 6: what's it all mean?
WebSpherePower News
Legal question: Can HP keep Hurd from going to Oracle?
Caringo announces integration with Symantec EV 9.0
Cisco & Citrix marry on virty PCs
Take Heed, Tech Giants: Edison's Failed Plot To Hijack Hollywood
IBM code unchains virtual workloads
Oracle names H-P ex-CEO Mark Hurd as co-president
Cloud Messaging Provider, Linxter, Releases SDK for Java and Android
>> Read all the news
More from the ZATZ journals
Computing Unplugged: Introducing the Jones family and their full-family backup challenges
David Gewirtz Online: CNN commentary and analysis
DominoPower: Lotus must open source Notes and Domino
OutlookPower: Hands on debugging a broken Outlook forwarding rule
-- Advertisement --

How To Save Jobs
This book is about how to create and save jobs. Believe it or not, there's not a single book out there that specifically focuses on job creation and preservation -- until now.

This book, by ZATZ editor-in-chief David Gewirtz, is about helping your business work better. It's about helping you change the things you need to change so your company can perform more effectively.

Plus, through a grant from ZATZ, it's a free download.

Read it and reap.

-- Advertisement --

Influencer. Recommender. Decision Maker.
They all read WebSpherePower Magazine. They all rely on WebSpherePower Magazine.

If you want to reach the inner-circle of IBM IT professionals, you won't find a better resource than WebSpherePower Magazine.

Click for our Media Kit

ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login