8 Replies Latest reply on Apr 4, 2014 8:24 AM by Ramesh Reddy

    Teiid VDBs for help

    lei wang Newbie

      I use Jboss as 7.1.1 and teiid 8.2 create a vdbs. The VDBs configure is:

      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>  
      <vdb name="SybiqVDB" version="1">  
      <description>My sybiq VDB</description>  
      <property name="UseConnectorMetadata" value="cache" />  
      <model visible="true" type="PHYSICAL" name="sybiq">  
      <property name="importer.useFullSchemaName" value="true"/>  
      <property name="supports-multi-source-bindings" value="true"/>  
      <source name="sybiq21" translator-name="sybase" connection-jndi-name="java:sybiq21DS"/>  
      <source name="sybiq22" translator-name="sybase" connection-jndi-name="java:sybiq22DS"/>  
      </model>  
      </vdb> 
      
      

      DataSource sybiq21(sybiq22) configure is:

      <datasource jndi-name="java:/sybiq21DS" pool-name="sybiq21DS" enabled="true" use-java-context="true">    
          <connection-url>jdbc:sybase:Tds:172.1.0.21:2640/dmpiq1</connection-url>    
          <driver>sybase</driver>    
          <security>    
              <user-name>zcss7db</user-name>    
              <password>zcss7db</password>    
          </security>
          <validation>
              <check-valid-connection-sql>select name from sysobjects where type='U' order by name</check-valid-connection-sql>
          </validation>    
      </datasource>    
      <datasource jndi-name="java:/sybiq22DS" pool-name="sybiq22DS" enabled="true" use-java-context="true">    
          <connection-url>jdbc:sybase:Tds:172.1.0.22:2640/dmpiq1</connection-url>    
          <driver>sybase</driver>    
          <security>    
              <user-name>zcss7db</user-name>    
              <password>zcss7db</password>    
          </security>
          <validation>
              <check-valid-connection-sql>select name from sysobjects where type='U' order by name</check-valid-connection-sql>
          </validation>    
      </datasource>
      

      DataSource sybiq21DS hava one table vdb_gprs but DataSource sybiq22DS havn't.  The VDBs is running .Using Java code I can  get the correct query results.

      import java.util.*;
      import javax.naming.*;
      import javax.sql.DataSource;
      import java.sql.*;
      import java.io.*;
      public class connTest
      {
          public static void main(String[] args)
          {
          String url = "jdbc:teiid:SybiqVDB@mm://172.1.0.21:31000";
          String sql = "select count(1) from test";
          try
          {
      Class.forName("org.teiid.jdbc.TeiidDriver").newInstance();
          Connection connection = DriverManager.getConnection(url, "user", "user");
              Statement statement = connection.createStatement();
              statement.execute("set partialResultsMode true");
              ResultSet results = statement.executeQuery(sql);
              while(results.next()) {  System.out.println(results.getString(1));  }
              results.close();
              statement.close();
          } 
      catch(Exception e)
      { e.printStackTrace(); }
      }
      }
      

      Now I want to write "statement.execution (" set partialResultsMode true");" To VDBs configuration file or To file “standalone-teiid.xml”  ,rather than in Java code setting. How should I set