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 files of the JDBC-supported database, you must copy the jar files from your computer to the pods such as HIP REST and HIP Server. These pods are responsible for the following actions:
  • HIP Server is responsible to establish a connection with the JDBC-supported database. This pod also generates a schema by using the tables of the database. The structure of a schema is a flat hierarchy, where all the item types are in a single group called a Row. The item types in a schema refer to the columns of the table.
  • HIP REST is responsible to run the map and generate the data. This pod also writes the generated data to the JDBC-supported database.

Both the pods use the connector jar file to communicate with the JDBC-supported database.

You can download the connector jar files from the following locations:

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 with the database server.
  2. Copy the connector jar file from your local file system to the pods 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

    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

    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 pods.
    • While copying the jar files to the pods, you must ensure that the names of pods are same as those installed on HCL OneTest Server.
      For example:
      • HIP Rest is displayed as {my-ots}-hip-rest-6757c99d9-4qjtl
      • HIP Server is displayed as {my-ots}-hip-server-0
    • When you install or restore HCL® OneTest Data, you must copy the connector jars files 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 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.

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.