0 Replies Latest reply on May 24, 2010 10:52 AM by Sekare-Oracle

    Programmatically connecting to BI server

    Sekare-Oracle
      Hi,

      I have to connect to the BI server using JDBC to run BI query.

      Connection details (BIAnalytics)
      ConnectionType: BI (JDBC)
      Username: <private>
      Password: <private>
      BI Host: <private>
      BI port: 9703

      I am using the following code to get this connection from data source

      Object obj = ADFContext.getCurrent().getConnectionsContext().lookup("TMBISrvConn");
      if (obj instanceof DatabaseProvider) {
      DatabaseProvider BIDB = (DatabaseProvider)obj;
      String userName = BIDB.getProperty(DatabaseProvider.USERNAME_CLASS_REFTYPE);
      String password = BIDB.getProperty(DatabaseProvider.PASSWORD_CLASS_REFTYPE);
      String hostName = BIDB.getProperty(DatabaseProvider.HOSTNAME_CLASS_REFTYPE);
      String port = BIDB.getProperty(DatabaseProvider.PORT_CLASS_REFTYPE);
      String connString = "jdbc:oraclebi://"+ hostName + ":" + port + "/user=" + userName + ";password=" + password + ";Catalog=";
      Connection con = BIDB.getConnection();
      }

      Error: "Unrecognized JDBC URL subtype: BI_JDBC"

      I tried using Driver manager

      String connString = "jdbc:oraclebi://"+ hostName + ":" + port + "/user=" + userName + ";password=" + password + ";Catalog="; Class bclass = Class.forName("oracle.bi.jdbc.AnaJdbcDriver");
      Connection connection = DriverManager.getConnection(connString);

      Error: "cannot find suitable driver"

      Thanks