usingdatabaseserversinmistudio
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| usingdatabaseserversinmistudio [2021/07/28 14:11] – wikiadmin | usingdatabaseserversinmistudio [2021/07/28 14:55] (current) – [Step Two: Create the Table] wikiadmin | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| This example will show you how to read and write a value to a database table in MIStudio. This example uses SQLite, which is built into MIStudio with the JDBC driver needed for the database. This example can be extended to any JDBC database but you will need to have this database set up and (very importantly) add the JDBC driver jar to the " | This example will show you how to read and write a value to a database table in MIStudio. This example uses SQLite, which is built into MIStudio with the JDBC driver needed for the database. This example can be extended to any JDBC database but you will need to have this database set up and (very importantly) add the JDBC driver jar to the " | ||
| - | ==== Preparation | + | ==== Example: Simple Read and Write a Single Value ==== |
| + | |||
| + | === Preparation | ||
| Start MIStudio and a new project. Add a Button and an Annunciator to the Design Window. These will be used later to trigger the database read and write. Copy both of these to the Diagram Window. | Start MIStudio and a new project. Add a Button and an Annunciator to the Design Window. These will be used later to trigger the database read and write. Copy both of these to the Diagram Window. | ||
| - | ==== Step One: Set up the Database Connection==== | + | === Step One: Set up the Database Connection=== |
| This example uses SQLite. With the Diagram Window visible, add a SQLiteConnectionManager from the Database tab to the Diagram Window. The SQLiteConnectionManager needs a database name. Enter " | This example uses SQLite. With the Diagram Window visible, add a SQLiteConnectionManager from the Database tab to the Diagram Window. The SQLiteConnectionManager needs a database name. Enter " | ||
| - | ==== Step Two: Create the Table ===== | + | === Step Two: Create the Table === |
| To enable reading and writing to the database, MIStudio must be put into LIVE mode. Toggle the " | To enable reading and writing to the database, MIStudio must be put into LIVE mode. Toggle the " | ||
| + | |||
| + | The first step is to create the table called " | ||
| + | |||
| + | <code sql> | ||
| + | CREATE ' | ||
| + | </ | ||
| + | |||
| + | |||
| + | ====Example: | ||
usingdatabaseserversinmistudio.1627495907.txt.gz · Last modified: by wikiadmin
