4 Replies Latest reply on Aug 26, 2009 5:17 PM by oneworld95

    Connect to JNDI datasource

    oneworld95

      Hi. I've got a JNDI datasource that our server admin created. It's called ora-forms-ds.xml and connects to an Oracle 10g instance. I've copied the file to my local JBoss' default instance (/default/deploy/) I'm using Eclipse and was wondering if there's a wizard-driven way to point to the JNDI. When I right-click the project and view Properties, it doesn't show an option for pointing to the JNDI data source.


      And then the New - Seam Generate Entities option on the project doesn't work, either. It only lets me create a new database connection which doesn't seem to have any options for JNDI. Thanks.

        • 1. Re: Connect to JNDI datasource
          kukeltje.ronald.jbpm.org

          Correct, analysis. There is no option to connect to jndi because you can't from eclipse.

          • 2. Re: Connect to JNDI datasource
            oneworld95

            Thanks, Ronald. I thought I was losing what little is left of my mind. If I manually edit the necessary files (components.xml, persistence.xml) will Eclipse recognize the connection or will it only recognize the non-JNDI database connections? (BTW, I've tried this, and have had no luck -- all kinds of errors.) Thanks.

            • 3. Re: Connect to JNDI datasource
              kukeltje.ronald.jbpm.org

              I've only used the non-jndi ones. But.... I'm only human...

              • 4. Re: Connect to JNDI datasource
                oneworld95

                I'm slowly making progress: Modified the hibernate-console.properties file to look like this:


                #File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
                hibernate.connection.password=
                hibernate.connection.username=
                hibernate.connection.driver_class=oracle.jdbc.driver.OracleDriver
                hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
                hibernate.connection.url=
                
                hibernate.connection.provider_class=org.hibernate.connection.DriverManagerConnectionProvider
                hibernate.datasource=java:/ora-forms
                hibernate.transaction.manager_lookup_class=



                When I do Seam Generate Entities, the database Refresh button gives this error; what should the driver string be for Oracle 10g?


                Can't generate seam entities
                  org.hibernate.exception.JDBCConnectionException: Getting database metadata
                  Getting database metadata
                    org.hibernate.exception.JDBCConnectionException: Getting database metadata
                    Getting database metadata
                    java.sql.SQLException: No suitable driver
                    No suitable driver