how to use vdb to query data from integrated datasource
724150880 Mar 13, 2014 5:11 AMhi,
i'm a newer for jboss.now i am using jboss AS 7.1 with Teiid 8.2. the vdb has been activied. and follow is vdb configuration file:
cat deployments/mysqltest-vdb.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<vdb name="myvdb" version="1">
<description>A Mysql VDB</description>
<property name="UseConnectorMetadata" value="true" />
<model name="mysql89m">
<property name="importer.useFullSchemaName" value="true"/>
<property name="importer.schemaPattern" value="zhangwf"/>
<source name="mysql89" translator-name="mysql5" connection-jndi-name="java:mysql89DS"/>
</model>
<model name="mysql90m">
<property name="importer.useFullSchemaName" value="true"/>
<property name="importer.schemaPattern" value="zhangwf"/>
<source name="mysql90" translator-name="mysql5" connection-jndi-name="java:mysql90DS"/>
</model>
</vdb>
and follow is vdb configuration file standalone-teiid.xml :
<datasource jndi-name="java:/mysql89DS" pool-name="mysql89DS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://192.168.7.89:3306/zhangwf</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>123</password>
</security>
</datasource>
<datasource jndi-name="java:/mysql90DS" pool-name="mysql90DS" enabled="true" use-java-context="true">
<connection-url>jdbc:mysql://192.168.7.90:3306/zhangwf</connection-url>
<driver>mysql</driver>
<security>
<user-name>root</user-name>
<password>123</password>
</security>
</datasource>
<datasource jndi-name="java:/teiidDS" pool-name="teiidDS">
<connection-url>jdbc:teiid:myvdb@mm://localhost:31000</connection-url>
<driver>teiid</driver>
<pool>
<prefill>false</prefill>
<use-strict-min>false</use-strict-min>
<flush-strategy>FailingConnectionOnly</flush-strategy>
</pool>
<security>
<user-name>admin</user-name>
<password>admin</password>
</security>
</datasource>
i want to know how to acess database with vdb ? and is it right that "select e.id,e.name from ((select a.id,a.name from mysql89m.zhangwf.test) union all (select b.id,b.name from mysql90m.zhangwf.test)) as e"?
or can someone offer some java API examples for me? by the way,if a server of vdb is down ,then is the whole vdb avilable?
thanks a lot.