1 Reply Latest reply on Jun 10, 2003 6:02 PM by stuart miller

    DataSource Information

    gcaponera222 Newbie


      Within my application, I need to access the information stored in my datasource configuration (mysql-ds.xml)- i.e. retrieve url,driver,etc. How do I go about that programatically ?


        • 1. Re: DataSource Information
          stuart miller Newbie

          You can connect to it from within an EJB using the local JNDI naming, and then get a connection and get the MetaData of that connection. See attached snipit for an example. However, I noticed sometimes that (on the second invocation of this code...) i get a "java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection". Perhaps it's best to create an ejb-ref to the DataSource in the bean?