How to Create a Valid SQL Script
In order to create a valid SQL script, you need to understand the basic configuration settings embedded into the script file to create a connection. These settings are based on Hibernate to map the database configuration settings correctly.
A list of the data needed to connect with the database follows: - User name - Password - URL (connection string) - Driver Class - Database name - Dialect - Connection delimiter
All of these items are required within the SQL script to set up a connection using ASE. Let’s have a quick look into it.
-
User name: corresponds to a valid user name registered in the database to access its records. Some SQL DB engines such as MySQL allows you to have users with remote access and user with no remote access, if you’re trying to reach a remote database make sure that the database has remote connections enabled and that the user you are providing has enough privileges.
-
Password: database user password that matches the provided user name credentials.
-
URL: the URL corresponds to the connection string used to directly connect to a database. This URL is the same URL used to create a database connection using a JDBC driver. I.E: Usual URL for a MySQL connection goes like this:
-
Driver Class: The driver class is the specific JDBC driver name used to specify to the Driver Manager which JDBC drivers you’re trying to make connections with. With MySQL Connector/J, the name of this class is com.mysql.jdbc.Driver. Note that each SQL database engine has its own JDBC driver class.
-
DB Name: It’s the name of the database you’re trying to reach.
-
Dialect: Here you must specify a concrete dialect for Hibernate to work with using the package org.appvance.hibernate.dialect. This package has been modified from its original qualified name adding “appvance” to avoid runtime issues. A list of these values has been provided in the charts located at the end of this document.
-
Connection delimiters: A couple of reserved words have to be added to the script to open and close the database connection. These words are: Connect and Disconnect. Their names are self-explanatory.
Last updated: March 24, 2023
If you have any feedback on this topic, please contact us at documentation@appvance.ai