Each AnyLogic model has a built-in fully integrated database to read input data and write simulation output. Using it, you can import data from MS Excel spreadsheets, MS Access or MS SQL Server databases and store it in the readily available form, log all model activities and statistics and export the database with the model.
However, the built-in database supports import from MS Excel, Access and MS SQL Server databases only. If you need to access databases of other types, or interact not with internal but with some external databases, you can use AnyLogic connectivity tools designed for interacting with external data sources.
To access an external database, add the Database element from the Connectivity palette to your model and use it to establish a connection it with an actual database.
Once the database connection is established, you can interact with the connected database using the following elements available on the Connectivity palette.
- Query — Writes queries and retrieves data from the database. Uses the retrieved data to create agent populations and collections.
- Insert — Inserts rows into the database table.
- Update — Updates records in database tables.
- Key Value Table — Maps keys and values specified in a database table.
-
How can we improve this article?
-