|
|
|
|
|
- Lesson 1 - Implementing a Client/Server database
- Overview
- Installing a local HFSQL server
- Adapting a website to use an HFSQL Client/Server database
- Opening the example project
- Adapting the project
- To sum up
- Further information
Tutorial - Managing an HFSQL Client/Server database
Lesson 1 - Implementing a Client/Server database We will cover the following topics: - Installing a local HFSQL server.
- Creating a website that uses an HFSQL Client/Server database.
- Adapting a website to manage an HFSQL Client/Server database.
10 min WEBDEV allows you to create applications/websites that access HFSQL Client/Server databases. The Client/Server mode allows you to host databases on a server (it can be different from the server where the website is deployed). This operating mode: - increases data security,
- allows you to easily manage multiple users,
- facilitates maintenance,
- allows for remote connections (for back-office operations, for example).
In this lesson, we will perform all the operations required to develop and deploy a website that uses an HFSQL Client/Server database. Installing a local HFSQL server The first operation to perform consists in installing an HFSQL server. This server can be installed on the development computer (that's what we are going to do). In the deployment phase, the server can be installed on a specific computer or directly on the server that hosts your website. The HFSQL server setup program is included in the WINDEV, WEBDEV and WINDEV Mobile setup media. If you don't have this media, the HFSQL server setup is also available on our site ( www.windev.com). To install the HFSQL server locally: - Start the WINDEV/WEBDEV/WINDEV Mobile setup program.
- Select "Install HFSQL Client/Server".
- Then, select "Install or update an HFSQL server".
- Accept the license agreement.
- Select a platform ("For Windows on this computer").
- If there are HFSQL servers already installed on the current computer, select "Install a new server".
- Select the installation directory and specify the server name and port. The port 4900 will be used by default.
Don't forget to open this port on the firewall in order to connect to the HFSQL server from another computer. - Specify the login credentials of the user with administrator privileges that will be created by default on the HFSQL server. By default, this user is "Admin" and has no password.
For security reasons, don't forget to change the administrator password. - Install the HFSQL Control Center if it is not already installed or cannot be accessed from your computer.
Warning
The HFSQL Control Center is required to manage the HFSQL Client/Server database.
- The wizard prompts you to configure the sending of notifications to identify server problems in real time. In this case, go to the next step and indicate that the settings will be defined "Later".
- The wizard allows you to enable the Active Directory authentication. Enable this option if necessary.
- You can help us improve by allowing us to collect information regarding the use of our products. This optional and anonymous collect allows PC SOFT to improve the product features.
The installation is completed. By default (if you have not changed the administrator settings), to connect to the server in administrator mode, you must use the "Admin" user without password. Note: In this tutorial, we explain how to adapt an existing application to Client/Server mode. However, once the HFSQL server has been installed, you can directly develop an application that uses HFSQL Client/Server data. The only difference with a project that uses HFSQL Classic data is the format of the data manipulated in the analysis. The databases used by the project are in "HFSQL Client/Server" mode. Adapting a website to use an HFSQL Client/Server database Switching an HFSQL Classic database to Client/Server is the most common operation. WEBDEV includes multiple solutions to perform this operation: - from the data model editor.
- from the HFSQL Control Center.
To better understand the different steps, we are going to change the "Full WEBDEV Site" project to Client/Server mode using the data model editor. Opening the example project This tutorial uses the "Full WEBDEV Site" project. To open this example: - Go to the WEBDEV home page (Ctrl + <).
- On the home page, click "Tutorial", then in "Tutorial - Manage an HFSQL Client/Server database", click "Open exercise project".
Warning
This project will be used in the different lessons of this tutorial.
Adapting the project To adapt the "Full WEBDEV Site" project: - Load the analysis of your project in the data model editor. To do so, click in the quick access buttons of the WEBDEV menu. The data model editor is displayed.
- In the ribbon, on the "Analysis" tab, in the "Connection" group, click "New connection". A wizard opens, allowing you to create a connection.
- Select the type of connection to create: "HFSQL Client/Server".
Go to the next step.
- In the following steps, specify:
- the name of the server on which the HFSQL Client/Server server was installed (localhost if it was installed on your computer, for example), and the port number.
- the username and password (to use the administrator, specify the login credentials defined when the HFSQL server was installed).
- the database name ("Full_WEBDEV_Site" in our example).
- the name of the connection (keep the default name).
- Go to the next step and validate. The connection to the database is automatically created. A dialog box prompts you to associate the different data files from the analysis with the connection that was just created.
- Click "Yes".
- In the next step, select all the data files:
Go to the next step.
- A dialog box prompts you to copy the data files to the server. Validate ("Copy now").
- Select the data files that will be copied onto the server: in our case, all the data files found in the EXE directory.
- Go to the next step and validate.
- The data files in the analysis are automatically changed into HFSQL Client/Server data files and associated with the selected connection.
- Generate the analysis: In the data model editor, on the "Analysis" tab, in the "Analysis" group, click "Generation". An automatic modification of the data files is automatically proposed. If all the data files are up to date, the automatic modification of the data files can be canceled.
Recommendations to switch to Client/Server mode- Check the code in your project. In HFSQL Client/Server mode, HSubstDir and other similar statements have no effect.
- You can modify the connection defined in the analysis with HOpenConnection and HChangeConnection according to the parameters specified when it was created.
- HOpenConnection allows you to switch to HFSQL Classic mode. Simply specify the path of the directory containing the HFSQL Classic data files.
- The development project was successfully adapted. You may also have to adapt the deployed website (if the deployed site uses HFSQL Classic data files, for example). This operation is configured when creating the website setup program.
In this lesson, we saw how to install a local HFSQL server. We adapted a WEBDEV project to use an HFSQL Client/Server database. In the next lesson, we will see how to manage an HFSQL Client/Server database. In this lesson, we saw how to adjust some settings in the website to use an HFSQL Client/Server database. HFSQL Client/Server offers many specific features that we won't cover in this tutorial:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|