3 Replies Latest reply on Jul 10, 2009 10:17 AM by rareddy

    Request VDB

      Hello,
      I'm playing with Teiid designer from a couple of days and that's good!
      Now, I integrated it in our RCP application (keeping the perspectives) and I'm trying to make the link between our project and your.

      The aim of this work is to use Teiid designer to create VDBs and then use our objects to request them.
      We have 2 objects:
      * the 1st is called DataRepository and it is used to specify JDBC parameters (URL, user, password)
      * 2nd one is called DataSet to write and test requests (this object is linked to the DataRepository to get the JDBC driver parameters). this is very similar than the sqlExplorer!

      So the idea, is to used your EmbeddedDriver in the DataRepository (we will specify the VDB in the URL) and then use the DataSet to request the VDB.

      So my questions are:
      Do you have in all your plugins one that can I use to execute request on VDBs? and how can I use it?
      An other question concerns the deployment of connectors: how can I get the information about the connectors in order to deploy the VDB and all things needed by it (I tried the Quick start example using the derby JDBC driver and I had to add it manualy in the classpath in order to execute the script that run the request) ?

      thanks

        • 1. Re: Request VDB
          rareddy

          Designer does not provide any API to call into VDB to query for the data directly. Teiid "embedded" runtime does. Designer uses Teiid "embedded" in its plug-ins to support the preview and SQL-Explorer functionality. So, take look at Teiid "embedded".

          By default all the connectors are loaded into a separate class loader to avoid the conflicts between jars that are already available in the runtime environment. There are couple ways you can handle this issue (only in embedded, not designer)

          1) You can copy the JDBC Driver's Jar file in the "lib" directory of the "embedded" then you do not need to set classpath, as the required jars are loaded into boot classpath. (conflicts may occur, so be cautious)

          2) The "embedded" provides, Admin API. This is management API with which you can control add/update/delete of the connectors at runtime. So, you can programatically call to set classpath. Look at javadoc on com.metamatrix.jdbc.api.Connection and follow the getAdmin call.

          • 2. Re: Request VDB

            thanks for you quick reply, now I understand!

            I had a look on the plugins:
            * org.teiid.designer.dqp
            * org.teiid.designer.dqp.ui
            and I found all the information I need.

            Now, I will try to use the org.teiid.designer.dqp to have a runtime environment for "embedded" and will create an other plugins similar to org.teiid.designer.dqp.ui in order to manager the admin part (deploying VDB, executing requests, ...). All this information can be found in the classes QueryClient, VdbExecutor, ....
            That's sound good for the integration of the both product (tell me if I missed something).

            FI, dqp means Designer Query Plugin ?

            • 3. Re: Request VDB
              rareddy

              DQP = Distributed Query Processor

              You are in right with assumption about org.teiid.designer.dqp plugin. This fronts another plugin called org.teiid.embedded where the actual "embedded" runtime is in, which is what you want to use, not dqp directly. The way we have these defined it may be not ideal or may be changing in future releases as we used some of non-public api to support the legacy functionality.

              "embedded" runtime + plug-in = org.teiid.embedded

              I would suggest you starting fresh with copy "embedded" runtime, wrap it in a plug-in and write your client on top of it. We strive to keep the backwards compatibility with public apis like JDBC and Admin API. This option will increase your download size another 20MB, but your code will be completely independent to that of Teiid, as you only depend on JDBC API.

              If you choose to use org.teiid.embedded, the manifest.mf defines the class loading some what different from what Teiid prescribes in the "File path" profile at http://www.jboss.org/community/wiki/TeiidEmbeddedDeploymentProfiles, ideally you would want to avoid what is defined in plug-in.

              Teiid team also in discussions to replace SQLExplorer with Eclipse Data Tools in future, does your project make use of this? If it is or has flexibility in choosing it, you can think of contributing this to Teiid. (of course we need to know more about DataRepository and DataSet)

              Hope that helps.

              ps: "embedded" runtime is separate download apart from the "Teiid Designer" on the Teiid site.