Exception: "org.appvance.hibernate.exception.GenericJDBCException: Cannot open connection"
Exception may appear in error logs within a controller while executing a Database Scenario
This topic assumes you are capable of creating sql scripts in MYSQL or other similar, as well as capable of creating Scenarios using Appvance UTP.
-
Grant all the privileges for the database user you are logged in as.
-
Execute the query below to resolve the aforementioned exception: GRANT ALL PRIVILEGES ON (database name). (table_name) TO ‘ user’@‘localhost’ WITH GRANT OPTION;
-
In the event you are creating new database and new user, execute the query below to grant necessary privileges:
Ex:create a database "Apptest" with table name test
create a user and grant the privileges:
CREATE USER 'apctest1'@'localhost' IDENTIFIED BY 'apctest1';
CREATE USER 'apctest1' IDENTIFIED BY 'apctest1';
FLUSH PRIVILEGES;
GRANT SELECT, EXECUTE, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, LOCK TABLES, UPDATE, REFERENCES, INSERT, INDEX, DROP, DELETE, CREATE VIEW, CREATE TEMPORARY TABLES ON `apctest1`.* TO 'apctest1'@'localhost' WITH GRANT OPTION;
GRANT SELECT, EXECUTE, SHOW VIEW, ALTER, ALTER ROUTINE, CREATE, CREATE ROUTINE, LOCK TABLES, UPDATE, REFERENCES, INSERT, INDEX, DROP, DELETE, CREATE VIEW, CREATE TEMPORARY TABLES ON `apctest1`.* TO 'apctest1'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON Apptest.test TO ‘apctest1’@‘localhost’ WITH GRANT OPTION;
where
-
Apptest - Database Name
-
test - Table_name
-
apctest1 - User of the example database/table and user that was created.
-