Database connection
This guide has been reviewed and reformatted for Ruk-Com Cloud PaaS. Screens may vary slightly by platform version.
Click or tap a screenshot to view it at its original size.
Objective
This guide explains how to use Database connection on Ruk-Com Cloud PaaS, with ordered procedures and practical verification points.
Before you begin
- Sign in with an account permitted to manage the relevant environment.
- Confirm the target environment, region and resources before saving changes.
- Create a backup or rollback plan before changing a production system.
All instances created in Ruk-Com Cloud are created as independent Containers. Connecting to the database from the application You need to set a Connection String to connect to the Database Server.
- CNAMEof the database, such as node{node_id}-{environment_name}.{hoster_domain}
- Private IP Address(Every Container always has an IP number for reference)
- Public IP address(In case there is a request for additional activation)
Unable to connect as localhost to connect Database in Ruk-Com Cloud Platform because the design separates the Database part from the Application Server to make it easier to scale (Modern Apps).
Connecting to a Database The commands and connection methods depend on the structure of the language you are using.
Database Connections for Java Apps
Look at the database type table to find the appropriate database connection code for your application.
For UTF-8 encoding, edit your Connection String as follows:
jdbc:{dbtype}://{dbtype}{node_id}-{environment_name}.{hoster_domain}/{dbname}?useUnicode=yes&characterEncoding=UTF-8
Database Connection for PHP Apps
Based on database type Check out the connection code example below and customize your application accordingly.
It is necessary to specify hostname without http://. Connection values will be sent to Email automatically. Recommended to refer to Email.