Skip to content

Commit

Permalink
One more attempt to communicate clearly.
Browse files Browse the repository at this point in the history
  • Loading branch information
patelanil committed Dec 21, 2024
1 parent a9ce1e9 commit cc513e4
Showing 1 changed file with 25 additions and 41 deletions.
66 changes: 25 additions & 41 deletions moqui-framework/beginner/database-setup.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
## Introduction
# Assignment: Configure Moqui to use MySQL database for application development.

This guide focuses on setting up a database, loading data, and creating a custom Moqui component.

### Database Setup and Data Load

Install MySQL version 8.0.32 or higher.

#### Framework Setup for Development

Follow [getting started guide](getting-started.md)
### This assignment tests your ability to:

## Assignment
* Work with gradle.
* Install MySQL.
* Use of CHARACTER SET utf8.
* Why this setting?
* How does it change the MySQL behavior?
* What other character sets are available?
* What is JDBC Driver?
* Explain `Class.forName(“oracle.jdbc.driver.OracleDriver”);`
* What is the IP address of your laptop at this moment?
* What is significance of entity_ds_host in `<default-property name="entity_ds_host" value="127.0.0.1"/>`?
* Explain `127.0.0.1` and `localhost`
* Discuss, How CSV data is loaded in the database by Moqui framework?

### Tasks

#### 1. Database Setup

* **Add JDBC Driver:** Add the MySQL JDBC driver dependency to your custom component's `build.gradle` file:
* Install MySQL version 8.0.32 or higher.

* MySQL Connector/J 8.0.32
* Add JDBC Driver: Add the MySQL JDBC driver to Moqui setup on your computer. Use MySQL Connector/J 8.0.32

* **Create Database:** Create a database named `moqui` (with UTF-8 character set) using the following command:
* Create Database: Create a schema named `moqui` to your Moqui setup. Ensure it's configured for UTF-8 character set).
```sql
CREATE DATABASE moqui CHARACTER SET utf8;
```
* **Update Configuration:**
* **Development:** Modify `runtime/conf/MoquiDevConf.xml` with your MySQL database name, username, and password:
* Update Configuration:
* Development: Modify `runtime/conf/MoquiDevConf.xml` with your MySQL database name, username, and password:

```xml
<default-property name="entity_ds_db_conf" value="mysql"/>
Expand All @@ -34,14 +35,10 @@ Follow [getting started guide](getting-started.md)
<default-property name="entity_ds_user" value="moqui"/>
<default-property name="entity_ds_password" value="moqui"/>
```
*Note: For additional guidance, watch this video: [https://youtu.be/i4JUYTGiKSE](https://youtu.be/i4JUYTGiKSE)*

#### 2. Prepare Demo Data (for `MoquiTraining` entity)

Create sample data files in XML, JSON, and CSV formats for your `MoquiTraining` entity.

#### 3. Data Load
* Prepare Demo Data (for `MoquiTraining` entity). Create sample data files in XML, JSON, and CSV formats for your `MoquiTraining` entity.

* Data Load
1. Navigate to the `moqui-framework` directory.
2. Run the following command to load the data:
```bash
Expand All @@ -53,25 +50,12 @@ Create sample data files in XML, JSON, and CSV formats for your `MoquiTraining`

Push the newly added data files from your custom component to your "moqui-training" repository on GitHub.

### Resources
### Tutorial
[Database Configuration in Moqui](https://youtu.be/i4JUYTGiKSE)

### Additional Resources
1. https://www.youtube.com/watch?v=i4JUYTGiKSE&list=PL6JSOz3-TrFSMiuGounNRnje-JQDi8l8g&index=7&t=332s
2. https://www.youtube.com/watch?v=wzakiTwXGEo&list=PL6JSOz3-TrFSMiuGounNRnje-JQDi8l8g&index=14&t=159s
3. https://www.youtube.com/watch?v=i2g6X_huUUg&list=PL6JSOz3-TrFSMiuGounNRnje-JQDi8l8g&index=24
4. https://www.youtube.com/watch?v=b-2Wu4CC1hg

### This assignment tests your ability to:

* What is gradle?
* Install MySQL
* What is CHARACTER SET utf8?
* Why this setting?
* How does it change the MySQL behavior?
* What other character sets are available?
* What is JDBC Driver?
* Explain `Class.forName(“oracle.jdbc.driver.OracleDriver”);`
* What is the IP address of your laptop at this moment?
* What is significance of entity_ds_host in `<default-property name="entity_ds_host" value="127.0.0.1"/>`?
* Explain `127.0.0.1` and `localhost`
* Discuss, How CSV data is loaded in the database by Moqui framework?


0 comments on commit cc513e4

Please sign in to comment.