7 Replies Latest reply on Aug 15, 2003 9:27 AM by Roger Tan

    My Problem of Using Oracle as DataSource

    sakyamuni Newbie

      I want to use Oracle as DataSource, My Jboss Version is 3.0.7
      I dropped the docs\example\jca\oracle-service.xml in the deploy dir and jboss console shows success:
      [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.7/server/all/deploy/oracle-service.xml
      [JBossManagedConnectionPool] Creating
      [JBossManagedConnectionPool] Created
      [LocalTxConnectionManager] Creating
      [LocalTxConnectionManager] Created
      [JBossManagedConnectionPool] Starting
      [JBossManagedConnectionPool] Started
      [LocalTxConnectionManager] Starting
      [OracleDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/OracleDS'
      [LocalTxConnectionManager] Started
      [MainDeployer] Deployed package: file:/C:/jboss-3.0.7/server/all/deploy/oracle-service.xml

      but How can I use this connection pool?
      My codes:
      Properties pr = new Properties();
      pr.put(InitialContext.PROVIDER_URL, "");
      InitialContext initialContext = new InitialContext(pr);
      DataSource ds = (DataSource) initialContext.lookup("OracleDS");
      Connection conn = ds.getConnection();

      javax.naming.NameNotFoundException: OracleDS not bound

      what's the problem?
      thanks alot!