Pasos | Descripción | |||
1. DataBase Creation | Create only the database on the chosen DBMS; The schema set (tables, primary keys, triggers ...) will be created automatically later on a first deployment, at a time when the application recognizes that it does not exist. The process will vary slightly:
CREATE USER DASHBOARDSII IDENTIFIED BY DASHBOARDSII;
CREATE DATABASE sii […];
CREATE SCHEMA DashboardSII; | |||
2. Configuration of the SIIDashboard.properties property file | It copies the properties file used by the dashboard in the desired path. A good choice would be the server's configuration folder; In the case of Apache Tomcat, the '/ conf' folder. Although it could be anywhere else. The path where it is saved will be used later to give value to an environment variable that the application will use to retrieve the identifier of the tenant. Therefore, this property file will basically have a single property.
| |||
3. Configuring the connection to the database | The configuration of the connection to the database (url, user, password, driver...), can be done either through the web container itself or through the properties file of the application. | |||
| Although the specific way to do this configuration will depend on the chosen server, we will use as a reference example the Apache Tomcat server, because it is the server on which the solution has been developed and tested. The specific configuration will depend on the database engine used (Oracle, SqlServer or MySql): | |||
| JNDI resource name: jdbc / SIIOracle For Apache Tomcat, in the file 'server.xml', within the <GlobalNamingResources> block, a new <Resource> tag is added with the connection data to the database.
For Apache Tomcat, in the 'context.xml' file we create a new <ResourceLink> entry inside the <Context> block to reference the connection to the database previously declared in the file 'server.xml'.
If we set the value for the attributes "global" and "name" match the name given to the resource we created earlier. Copy in the '/ lib' directory, if it does not exist, the Java connection library to Oracle: ojdbc7.jar | |||
| JNDI resource name: jdbc / SIISqlserver For Apache Tomcat, in the file 'server.xml', within the <GlobalNamingResources> block, a new <Resource> tag with the connection data to the database is added.
For Apache Tomcat, in the 'context.xml' file we create a new <ResourceLink> entry inside the <Context> block to reference the connection to the database previously declared in the file 'server.xml'.
If we set the value for the attributes "global" and "name" match the name given to the resource we created earlier. In the '/ lib' directory, copy the Java library to SqlServer: sqljdbc4-6.0.jar | |||
| JNDI resource name: jdbc / SIIMySQL For Apache Tomcat, in the file 'server.xml', within the <GlobalNamingResources> block, a new <Resource> tag with the connection data to the database is added.
For Apache Tomcat, in the 'context.xml' file we create a new <ResourceLink> entry inside the <Context> block to reference the connection to the database previously declared in the file 'server.xml'.
If we set the value for the attributes "global" and "name" match the name given to the resource we created earlier. Copy to the '/ lib' folder, if it does not exist, the Java library connecting to SqlServer: mysql-connector-java-5.1.42.jar | |||
| Alternatively, you can define the database connection data via the 'SII-Dashboard.properties' property file. In this case the properties to be specified are:
| |||
4. Declaration of the path to the properties file | We create an environment variable with the path where the 'SII-Dashboard.properties' property file we have copied previously. For Apache Tomcat, the context.xml file defines a new <Environment> entry within the <Context>
The full path where the property file is specified as value of the attribute "value" | |||
5. BD's profile statement | In the configuration file 'context.xml' of Apache Tomcat, a new variable is defined to indicate the profile used according to the database.
| |||
6. Set Java configurations at startup of the application server |
|
General
Contenido
Integraciones