Hi!
Here is a short summary of the different steps necessary to connect AnyLogic to a PostgreSQL database.
- Download and install PostgreSQL (
http://www.postgresql.org/download/windows)
- Install pgJDBC via the PostgreSQLl's Application Stack Builder tool
- Create a database using the PgAdmin III tool (for instance)
- Copy the pgJDBC java driver files to the model's folder.
- Open the model in AnyLogic, select it in "Project" view and import driver JAR file on
"Dependencies" tab. Please do not forget to turn off "Import to model folder" option since you've
already done it .
- Go to the advanced properties of "Main" and type the following line in "Import section": import
org.postgresql.Driver; (Don't forget the semi-colon...)
- Select "database" and type "org.postgresql.Driver" in "JDBC driver".
- Specify the connection URL. (see
http://jdbc.postgresql.org/documentation/84/connect.html)
- Specify login and password for the database.
Voila!
Daniel
Pavel — 13.08.10
Hi Daniel!
It's the great post! Thank you!
Farzad — 26.08.10
Hi Daneil,
A really great post. You saved 2 days of my life :)