Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Websphere and the fly likes Setting up a datasource in WebSphere Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Setting up a datasource in WebSphere" Watch "Setting up a datasource in WebSphere" New topic
Author

Setting up a datasource in WebSphere

Kevin Cheong
Greenhorn

Joined: May 17, 2006
Posts: 10
I'm using RAD but this is more of a question about how datasources are setup in Websphere in general. I'm trying to explain what I know and I have some questions at the end. Please correct me if I'm wrong. Any help is appreciated!

From my perspective, it seems like it can be done two ways? In the admin console or through modifying the application.xml and web.xml files?

In the admin console, I would create the datasource via the Resources tab and when installing the application, I would bind the datasource to the web modules.

The other way which I'm setup now is to setup the datasource in the application.xml file, under the deployment tab when viewed in RAD. I will also have to bind the datasource in the web.xml file, references tab. No config is necessary in the admin console for this method.

So what's the difference of both of the methods? I can see how it will be useful to define it in the application.xml file since we don't have to recreate the datasource for every different server. Anything else?

Which is more commonly used?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

When you configure the datasource in the xml files, you are creating a rapidly deployable application, which is fun in the test environment, but administrators hate it - from my perspective, it is not a scalable or manageable solution.

The ability to configure datasources right alongside the xml files is new with WebSphere 6. Maybe I haven't used itenough, but it seems to take alot of control away from Administrators at deployment time.

Set your datasources up manualy on you app server. It's better.

-Cameron McKenzie
Kevin Cheong
Greenhorn

Joined: May 17, 2006
Posts: 10
Thanks for the reply. That really helps. I think the deployment descriptors help for local use since you don't want to be setting up the bindings each time you recompile and deploy your code on your local machine.

I can see how it will be a limitation once you use that EAR file in other environments, using different schemas/user, url, etc.

Do you know which file to exclude from the EAR file to exclude this? I want it setup on my local machine but I don't want it in the EAR which I'm using Ant to build.
 
Don't get me started about those stupid light bulbs.
 
subject: Setting up a datasource in WebSphere