Setting up the Environment
Setting up the Environment
Now let’s see how to create thean SQL script using thesethe required configuration settings. WeIn havethis createdexample, we use a database named: “appvancetest”. ThisMySQL database hasnamed appvancetest with a worker table named: “worker” which hascontaining the following columns:
idworkernamelastname
The database wascan installedbe using MySQLhosted on a local or remote machinemachine. identifiedMySQL asuses “appvance00”port 3306 by default, although the port may vary depending on ouryour localdatabase intranet, with MySQL Server running on port 3306.configuration.
1.
Configure the database connectionThe first step is to add the Hibernate settings we need in order to run the script. This configuration setting must be set like this in our case:
As you can notice, we have provided the respective values for each of the configuration settings neededrequired to connect to our database. These values must come as the headerdatabase ofand execute the script.
The
configuration settings must be defined at the beginning of the SQL script, before any SQL actions are executed.As shown in the example, provide the appropriate value for each setting required to establish the database connection.
These settings are specific to your database environment. For example, the database host, database name, username, password, and port must correspond to the MySQL instance you want to access.
2. Add the SQL actions
After providing proper values ondefining the header,connection wesettings, can continue by addingadd the connect delimiter before the SQL actions,actions.
You can then youadd can embed yourthe SQL actions,statements andthat finallyyou want to execute. Once all SQL actions have been defined, add the disconnect delimiter. In our case, we want to insertclose the database connection.
For example, a script that inserts a new record into the databaseworker only.table Syntax:follows this structure:

-- Hibernate configuration settings
connect
INSERT INTO worker (idworker, name, lastname)
VALUES (1, 'John', 'Doe');
disconnect
The exact configuration values and SQL statement will depend on your database environment and the operation you want to perform.
These are the two basic steps tofor createcreating a valid SQL script for ASE and useusing it in a scenario to runexecute adatabase-related test on that database. In our case the whole file should look like this:actions.
Important
- The
mustconfigurationtype “--“before every setting in order to take effect and the file extensionsettings must be‘placed before the SQL actions. - Type
--before each configuration setting so that ASE recognizes the setting. - The SQL script must use the
.file extension.sql’.sql - Make
Last updated: MarchAugust 08,13, 20232026
If you have any feedback on this topic, please contact us at documentation@appvance.ai.


