What is XTS?

XTS stands for Extract Table Schema. In this approach GenRocket can retrieve one, many or all table schemas from a given database by connecting directly to the database via JDBC to extract the database’s schema. The extracted schema is saved to an encrypted file. The encrypted file can then be imported to the GenRocket web application to automatically do the following:

  • Import the application / database Data Schema
  • GenRocket XTS and Data Warehouse will automatically set up all of the Domains, Attributes and assign Generators
  • You will use the Domain Referencing Wizard to establish Parent-Child-Sibling relationships for the Domains
  • You will swap out the Generators that were incorrectly assigned by the Data Warehouse for the correct Generators and modify Generator parameters      


Description

The following command line options instructs GenRocket to retrieve one, many or all table schemas from a given database by connecting directly to the database via JDBC to extract the database's schema.  The extracted schema is saved to an encrypted file.  The encrypted file can then be imported to the GenRocket web application to automatically create Domains for each table whose schema is defined within the encrypted file.



Commands

-xts,
--export-table-schema <<pathToJDBCFile> <tableNames>> 


Required Parameter

  • <pathToJDBCFile> - defines the path and file name of the JDBC Properties file 
    • Example: /home/jdoe/config/config.properties 


Optional Parameter

  • <tableName> - defines the names of one or more tables whose schema is to be extracted  
    • Example: genrocket -xts /home/jdoe/config/config.properties company,department,user
    • If table belongs to a particular schema in your database, e.g. schema1then your command should include schema name as well
      • Example: genrocket -xts /home/jdoe/config/config.properties schema1:company,schema1:department, schema1:user
    • If you want to export all tables of your schema, use <schemaName>:*
      • Example: genrocket -xts /home/jdoe/config/config.properties schema1:*
    • Importing tables from more than one schema
      • Example: genrocket -xts /home/jdoe/config/config.properties schema1:user,schema2:address
  • Note
    • By not providing any table names, all table's schema within the given database will be extracted
    • To extract specific tables for Oracle database, please use schema/table names in uppercase.



Connect to a Database

The GenRocket table schema importer must connect to a database via JDBC. It connects to a database by accessing a user's profile and then reading the configuration file passed in the command line with the -xts option.



JDBC Configuration File

The JDBC configuration file must contain the following four parameters (the order of the parameters does not matter):

  • driver - The name of the database driver    
  • user - The username to connect to the database
  • password - The password to connect to the database
  • url - The universal resource locator to connect to the database 


    

Example JDBC Configuration File

The following example configuration file connects to a MySQL database called, acme.


      driver=com.mysql.jdbc.Driver    

      user=root        

      password=admin    

      url=jdbc:mysql://localhost:3306/acme



Note: For Oracle, if you face the following exception in creating the XTS file


ORA-01000: maximum open cursors exceeded


The Config file needs to have 1 more property. 


      connnection=NEW


This property creates the new Connection to read each table information.



Sequence of Events

The following sequence diagram describes the steps that GenRocket executes once an -xts command is given:



How to import Domains from an XTS File


To learn how to import Domains from an XTS File, click here.