1 Reply Latest reply on Mar 2, 2017 9:34 AM by Ramesh Reddy

    Teiid embedded - JDBC translator

    parrotola Novice

      Hi,

      is it possible to build dynamic vdb-xml using jdbc-translator and JAVA API? For istance build that xml from table "spatial_ref_sys" automatically using postgres translator.

       

      <model name="ptgsName">
      <source connection-jndi-name="java:/postgresC" name="ptgsName" translator-name="postgresql"/>
      <metadata type="DDL"><![CDATA[
      
      CREATE FOREIGN TABLE spatial_ref_sys (
        srid integer NOT NULL OPTIONS(NAMEINSOURCE '"srid"', NATIVE_TYPE 'int4', FIXED_LENGTH 'TRUE'),
        auth_name string(256) OPTIONS(NAMEINSOURCE '"auth_name"', NATIVE_TYPE 'varchar'),
        auth_srid integer OPTIONS(NAMEINSOURCE '"auth_srid"', NATIVE_TYPE 'int4', FIXED_LENGTH 'TRUE'),
        srtext string(2048) OPTIONS(NAMEINSOURCE '"srtext"', NATIVE_TYPE 'varchar'),
        proj4text string(2048) OPTIONS(NAMEINSOURCE '"proj4text"', NATIVE_TYPE 'varchar'),
        CONSTRAINT spatial_ref_sys_pkey PRIMARY KEY(srid)
      ) OPTIONS(NAMEINSOURCE '"public"."spatial_ref_sys"', UPDATABLE 'TRUE')
      ]]></metadata>
      </model>
      

       

      Ty for all