Storing Reports in ORACLE DatabaseBy 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 a ORACLE database, do the following:
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.
Now, you can successfully connect to sahireports
CREATE USER sahireports IDENTIFIED BY Sahipro1; GRANT CONNECT TO sahireports; GRANT ALL PRIVILEGES TO sahireports IDENTIFIED BY Sahipro1;
Download the ORACLE Connector, extract and copy ojdbc.jar file to
sahi/userdata/extlibfolder (create if needed).
infoChoose a ojdbc.jar that supports your Java runtime. For example, to use ORACLE Connector with Java 8, copy ojdbc8.jar to
# Specifies database type. # The inbuilt options are "mysql", "h2", "mssql" and "oracle" # Change jdbc parameters accordingly db.type=oracle #JDBC parameters for oracle database db.driver_name=oracle.jdbc.driver.OracleDriver db.jdbc_url=jdbc:oracle:thin:@localhost:1521:oracle db.user_name=sahireports db.password=Sahipro1
Change the db.user_name and db.password as required.
Run a script and check!