Creating a sample schema in a database

To generate a schema in HCL OneTest Data, you must create a schema with a table in the database.

About this task

After you download the connector jar file of JDBC-supported database, you must copy the jar files from your computer to the HIP REST and HIP Server pods. The HIP REST and HIP Server pods are responsible for the following actions:
  • The HIP Server pod is responsible to establish a connection with JDBC-supported database and generate a schema by using the tables of the database. The structure of a schema is a flat hierarachy, where all the item types are in a single group called as Row. The item types in a schema refers to the columns of the table.
  • The HIP REST pod is responsible to run the map and generate the data. The HIP REST pod also writes the generated data to the JDBC-supported database.

Both the HIP REST and HIP Server pods uses the connector jar file to communicate with JDBC-supported database.

Procedure

  1. Download the JDBC-supported database connector jar file to your local file system.
    Note: You must download the connector jar file that is compatible to the database server.
  2. Copy the connector jar file from your local file system to the HIP REST and HIP Server pod by using the following commands from the command prompt.

    For example, run the following commands if you are using the MySQL database:

    For HIP REST pod

    kubectl cp /<source path>/mysql-connector-java-8.0.19.jar {my-ots}-<hip rest podname>:/opt/runtime/extjar/mysql-connector-java-8.0.19.jar -n test-system

    For HIP Server pod

    kubectl cp /<source path>/mysql-connector-java-8.0.19.jar {my-ots}-<hip server podname>:/opt/hcl/hip/extjar/mysql-connector-java-8.0.19.jar -n test-system

    Notes:
    • Depending on the database you use, you must copy different connector jar files to the HIP REST and HIP Server pods.
    • You must provide the podname of HIP Rest and HIP Server as installed on the HCL OneTest Server server.
    • When you install or restore HCL OneTest Data, you must copy the connector jar file again.
  3. Create a schema with a table in the database by using the following commands from the command prompt.
    For example, you can use the following command to create a table in a schema:
    create schema <schema_name>;
    use <schema_name>;
        CREATE TABLE IF NOT EXISTS <table_name> (
        Column1 <DataType> Constraint,
        Column2 <DataType> Constraint,
        Column2 <DataType> Constraint,,,,,,
    );
    Remember: In HCL OneTest Data, you must refer to the schema name and the table name that you created by using this command.

Results

You have successfully created a sample schema with a table in the database.

What to do next

After you create a schema in the database, you must establish the connection between HCL OneTest Data and the JDBC-supported database. See Establishing a JDBC connection with HCL OneTest Data

Note: You can view the schema name that you created in the database as the value of the Catalog or Schema property in HCL OneTest Data.