2 Replies Latest reply on Jun 12, 2003 7:47 PM by jonlee

    Connecting to a JDBC Datasource from standalone Java apps

    cbowditch

      Hi,

      does anyone know if it is possible to connect to a JDBC data source from a standalone Java application.

      I can do this with Weblogic Data sources. The application simply connects to the JNDI, and does a lookup of the Datasource. However, in JBoss, the Data source names are always prefixed java: meaning they are only available within the server VM.

      Any idea would be gratefully received

      Chris

        • 1. Re: Connecting to a JDBC Datasource from standalone Java app
          cclerek

          I have the same problem, could you solve it?
          Anyone... ?

          Thanks !!!

          • 2. Re: Connecting to a JDBC Datasource from standalone Java app
            jonlee

            Currently, JBoss does not support this functionality and it may never be implemented. See this thread on the reasons why standard connection technologies do not work when the client is in a JVM external to the connection pool.

            Weblogic provides a solution to this through a proprietary RMI proxy implementation. However, from a performance perspective, it is difficult to see whether you make any real gains as you trade off connection cost times to the database through pooling, with the connection cost to the proxy and the cost for operating through two across-the-wire links to the end target.

            It is possible that in the long-term the AOP infrastructure may eventually allow your standard Java classes to access pools as they will be bound in the same VM. Have to wait and see how things develop.