Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Create a database for TermWeb to store data in (e.g. termweb). 
    • Open pgAdmin and right click on Databases and select New Database
      Name: termweb
      Encoding: UTF8
      Template: template0
      Collation: C
      Character Type: C

  2. Create a database login role (user) which TermWeb will connect as (e.g. termwebuser), with permissions for the database.
    • Create a new login role (right click on Login Roles and select New Login Role) and name it termwebuserSelect password: termwebpwd.
    • Set login role as database owner (right click on termweb database and select Properties). Select termwebuser as owner.

  3. Execute the grant_privileges_postgresql.sql file from the installation package to grant the necessary privileges to termwebuser.

  4. Connect as the new user before creating TermWeb tables. This is important, in order for the new user to also be owner of every table.
    • Right click on PostgreSQL server and select Disconnect server
    • Right click on PostgreSQL server and select Properties
    • Write termwebuser as username
    • Doubleclick on PostgreSQL server to connect (might need to do it twice, due to wrong password)
    • Write the password termwebpwd in order to connect with the new user

  5. Execute the termweb_postgresql.sql file from the installation package to create the database tables.
    • Select termweb database and click on SQL icon to open an SQL execution window.
    • Copy paste termweb_postgresql.sql content and execute query.

After successfully creating the TermWeb schema on a PostgreSQL database, you need to pass the credentials of your database in the context of Tomcat by following steps 2 and 3.
However, if you are planning to deploy TermWeb on a Heroku container, the following steps are not needed. Instead you can directly follow this tutorial on how to deploy on Heroku.
The reason for this is that a Heroku container has an embedded Tomcat server, which does not use context properties. That is why we don't configure the data source in Tomcat.
TermWeb is configured to use Heroku's standard way of reading the data source, i.e. to get the database credentials from the container's environmental variables.

2. Copy the PostgreSQL JDBC Driver to Tomcat

...