Storing Reports in PostgreSQL Database
By default Sahi stores its reports in a H2 database which is bundled in Sahi. Sahi reports can now also be logged in PostgreSQL database. To store in a PostgreSQL database, do the following:
Create a Database
Section titled “Create a Database”Create a database in PostgreSQL using any PostgreSQL client. Let us assume that the name of the database is sahireports
Creating Tables
Section titled “Creating Tables”The tables will be created automatically, once Sahi is restarted after performing the following steps. There is no need to run the db script manually.
Add PostgreSQL Driver Jars to Sahi Classpath
Section titled “Add PostgreSQL Driver Jars to Sahi Classpath”Download the PostgreSQL Connector, extract and copy postgresql-xxxxxx.jar to sahi/userdata/extlib folder (create if needed).
Point Sahi to use the PostgreSQL Database
Section titled “Point Sahi to use the PostgreSQL Database”Add the following to userdata.properties in sahi/userdata/config folder
# Specifies database type.# The inbuilt options are "mysql", "mssql", "postgresql", "oracle" and "h2"# Change jdbc parameters accordinglydb.type=postgresql
#JDBC parameters for postgresql databasedb.driver_name=org.postgresql.Driverdb.jdbc_url=jdbc:postgresql://localhost:5432/sahireportsdb.user_name=postgresdb.password=Change the user_name, password and database name as required.
Restart and Run
Section titled “Restart and Run”Restart Sahi. This will create the required tables in the database.
Run a script and check!

