![]() Public void importFromExternalDB( sourceConnection, In the case of PostgreSQL, the Connection URL property takes one of the following forms: ![]() Give a meaningful name, say “postgreInput”.Ģ. ![]() With the JDBC driver, you can now configure the Database Connectivity Tool:ġ. Setting Database Connectivity Tool and using a function Then copy all driver files into the model’s folder and import the driver’s JAR file (Java ARchive) into the Dependencies tab in the model’s properties.Ĭonnecting the JDBC driver to the model ( Dependencies tab in the model’s properties) You can download the JDBC driver for PostgreSQL from their official website. However, it won’t be able to connect with the external database without an appropriate JDBC driver created specifically for PostgreSQL. To establish the connection, we recommend using the Database Connectivity Tool. Let’s say PostgreSQL stores a weekly staff schedule and based on this data, you need to define the availability of resource units. You can learn how to do it using a real-life example. But what if the data is stored in a database like MySQL, Oracle Database, or PostgreSQL?įirst of all, you’ll need to establish a connection to the external database. You can import data from MS Excel/MS Access/MS SQL Server in a couple of clicks. In this post, you’ll learn how to import data from an external database using a JDBC driver to connect a simulation model with PostgreSQL and create a schedule in AnyLogic. Thanks to the built-in database option you can avoid it. Secondly, connecting to an external data source during a model run may affect the model’s performance. ![]() See an example of such controls in an article on Generating agent arrivals. Currently using a built-in database is the most convenient and efficient way to work with model data in AnyLogic.įirstly, many model elements have visual controls for retrieving data from database tables. Simulation models are based on data, and when you use data from an external database, we recommend you import it into an internal (built-in) database in AnyLogic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |