Prepare the database

In this tutorial you will learn how to read data from and write data to a database from your application. Check that you are using a database that is supported by the ProLinga-Data Project. In this tutorial a database called netadm will be used as well as a user name prolinga to connect to the database. Use the appropriate "CREATE DATABASE" and "CREATE USER" statements in your database environment to create the database and user. The user should have read and write access to the database.

An example of how to prepare a PostgreSQL and MySQL database is given here.

Preparation of PostgreSQL database

A correctly configured PostgreSQL database should be running on your system. For PostgreSQL specific installation and configuration issues, visit the Web Site of PostgreSQL for any help, as this falls outside the scope of this document.

To create the database in PostgreSQL, logon to a terminal/command line environment as the database administrator user (by default is this user postgres) and type:

$ createdb netadm

This should produce as response:

CREATE DATABASE

To create the database user prolinga, logon to the interactive terminal of PostgreSQL and type:

$ psql -h localhost -U postgres netadm

The user can then be created as follows:

netadm=# CREATE USER prolinga; 

Exit psql (\q) and test if you now can logon to the new database netadm with the new user name prolinga.

$ psql -h localhost -U prolinga netadm

If all went OK, you should see the psql prompt as follows:

netadm=>