|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 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 |
|
|
|
|
|
|
|
|
|
|