データベースアクセスコンポーネント
MZ PlatformにはJDBC(データベースへアクセスするためのJava標準API)ドライバーを介してデータベースに接続し、 SQL(Structured Query Language)と呼ばれる問い合わせ言語を用いて、格納されたデータの操作を行うことができる[データベースアクセス]コンポーネントが用意されていますこのコンポーネントを使って、データベースにアクセスし、データの検索や更新等を行います。
※MZ Platform3.6等以前のバージョンを使用している場合は、MZ Platformと共にインストールされたJava実行環境フォルダの¥lib¥ext(例:MZPlatform\Java\jre8_mz3.6_64\lib \ext)に配置してください。








|
MySQL接続情報 |
||
| 引数0 |
ドライバ名 |
com.mysql.cj.jdbc.Driver (MYSQL8.0以降) |
| 引数1 |
データベースのURL |
jdbc:mysql://ホスト名:3306/データベース名 例:jdbc:mysql://localhost/production |
| 引数2 |
ユーザ名 |
必須 (チュートリアルではroot) |
| 引数3 |
パスワード |
必須 |

| 列名 | データ型 | MZでのデータ型 | NULLの許容 | 特記 |
|---|---|---|---|---|
| id | int | java.lang.Integer(整数) | NO | Primary Key, auto_increment |
| label | text | 文字列 | YES | |
| product | text | 文字列 | YES | |
| delivery | datetime | 日付 | YES |
| 列名 | データ型 | MZでのデータ型 | NULLの許容 | 特記 |
|---|---|---|---|---|
| isCompleted | tinyint(1) | 論理 | YES | |
| dateEnd | datetime | 日付 | YES | |
| dateStart | datetime | 日付 | YES | |
| workingTime | int | java.lang.Integer(整数) | YES | |
| projectLabel | text | 文字列 | YES | |
| id | int | java.lang.Integer(整数) | NO | Primary Key, auto_increment |
| process | text | 文字列 | YES |
| id | label | product | delivery |
|---|---|---|---|
| 1 | A01 | A01 | 2023/11/11 |
| 2 | A02 | A02 | 2023/12/12 |
| isCompleted | dateEnd | dateStart | workingTime | projectLabel | id | process |
|---|---|---|---|---|---|---|
| 0 | 2023/11/08 12:00:00 | 2023/11/08 13:00:00 | 90 | A01 | 1 | めっき |
| 1 | 2023/12/05: 15:30:00 | 2023/12/05 18:00:00 | 150 | A02 | 2 | 検査 |
| 列名 | MZでの列名 | データ型 | MZでのデータ型 | 特記 |
|---|---|---|---|---|
| buhinid | 部品コード | varchara(10) | 文字列 | Primary Key |
| buhinmei | 部品名 | varchara(50) | 文字列 | |
| kijun | 在庫基準 | int | java.lang.Integer(整数) |
| 列名 | MZでの列名 | データ型 | MZでのデータ型 | 特記 |
|---|---|---|---|---|
| irai_id | id | int | java.lang.Integer(整数) | Primary Key, auto_increment |
| buhincode | 部品コード | varchar(10) | 文字列 | |
| suryo | 数量 | int | java.lang.Integer(整数) | |
| tantosha | 担当者 | varachar(20) | 文字列 | |
| iraidate | 依頼日 | date | 日付 |

以下の幾つかの方法があります。
1.サンプルデータをインストールした後、工程管理システム簡易版を実行して、動作を確認する
2.サンプルアプリケーション「データベースアクセス.mzax」を実行して、動作を確認する
3.MySQLコマンドラインで確認する