Storing Reports in ORACLE Database
By default Sahi stores its reports in a H2 database which is bundled in Sahi. Sahi reports can now also be logged in ORACLE database. To store in an ORACLE database, do the following:
Create a Database Connection
Section titled “Create a Database Connection”Create a database connection in Oracle using any Oracle client (Oracle SQL Developer). Let us assume that the name of the database connection is sahireports
To achieve database connection to sahireports follow the below steps,
Assuming you have installed Oracle Database and Oracle Client (Oracle SQL Developer).
Connect to SYSTEM and run the below query to create, connect and grant privileges to the user.
CREATE USER sahireports IDENTIFIED BY Sahipro1;GRANT CONNECT TO sahireports;GRANT ALL PRIVILEGES TO sahireports IDENTIFIED BY Sahipro1;
Now, you can successfully connect to sahireports
Add ORACLE Driver Jars to Sahi Classpath
Section titled “Add ORACLE Driver Jars to Sahi Classpath”Download the ORACLE Connector, extract and copy ojdbc.jar file to sahi/userdata/extlib folder (create if needed).
Point Sahi to use the ORACLE Database
Section titled “Point Sahi to use the ORACLE Database”Add the following to userdata.properties in sahi/userdata/config folder
# Specifies database type.# The inbuilt options are "mysql", "h2", "mssql" and "oracle"# Change jdbc parameters accordinglydb.type=oracle
#JDBC parameters for oracle databasedb.driver_name=oracle.jdbc.driver.OracleDriverdb.jdbc_url=jdbc:oracle:thin:@localhost:1521:oracledb.user_name=sahireportsdb.password=Sahipro1Change the db.user_name and db.password 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!

