Getting a list of DataSource JNDI names - Websphere

This is a discussion on Getting a list of DataSource JNDI names - Websphere ; Hi I want to get a listing of all the DataSources registered with WAS 5.1 along with their JNDI names. The actual requirement is to create a new DataSource using the Mbean API. One of the steps in this creation ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Getting a list of DataSource JNDI names

  1. Getting a list of DataSource JNDI names

    Hi

    I want to get a listing of all the DataSources registered with WAS 5.1 along
    with their JNDI names. The actual requirement is to create a new DataSource
    using the Mbean API. One of the steps in this creation is to check whether
    the JNDI name specified by the user is already in use by some other data
    source.

    I am using the DataSource Mbean to get a list of all the data sources and
    printing their JNDI names using the jndiName attribute in the DataSource
    Mbean. However, the API is not returning a complete list of all the
    DataSources that I can see from the WAS Admin Console. I also checked out
    the resources.xml file, and I think it is basically showing me only the
    DataSources listed in the resources.xml file.

    However, I see many more DataSources (more than the ones present in the
    resources.xml file) in the WAS Admin Console. Has anyone faced this problem
    before? It will be great if anyone could shed some light on this.

    Regards,
    Arati



  2. Re: Getting a list of DataSource JNDI names

    All a question of scope: there is a resources.xml at server, node and
    cell scope...

    Regards,
    David

  3. Re: Getting a list of DataSource JNDI names

    Hi David

    Yes, I know about the scope. I checked out the resources.xml files in the
    node and the server scope. We have only one server as of now. But, still
    there is a discrepancy between what I get and what I see through the
    console.

    The list of datasources that I get contains some datasources in the server
    scope and some in the node scope. And some are totally missed out. However,
    this is not because of the precedence of server jndi names over node level,
    because the names are different.

    Also, I am new to Mbeans, so I might be going wrong while querying the
    Mbeans. Currently, to get all the data sources, I am using the following
    query:
    WebSphere:type=DataSource,*
    Please let me know if this is correct. What should I do to get only node
    level datasources, or say server level data sources? I tried modifying the
    query as:
    WebSphere:type=DataSource,cell=PS2095,node=PS2095, server=server1,*. However,
    I get an empty list with this query.
    (PS2095 is the name of the machine where the Server is installed)

    Please help.

    Thanks,
    Arati

    "David Currie" wrote in message
    news:421E0EF2.9010706@hursley.ibm.com...
    > All a question of scope: there is a resources.xml at server, node and
    > cell scope...
    >
    > Regards,
    > David




+ Reply to Thread