diff --git a/test/README.txt b/test/README.txt index c7d16dfe..2e554f6e 100644 --- a/test/README.txt +++ b/test/README.txt @@ -5,4 +5,6 @@ test.appdir = apps/test/code test.repository.0 = apps/test/code test.repository.1 = modules/jala/util/Test/code -And you need to have a MySQL JDBC driver in lib/ext, as well as create the database schema provided in db.sql. +And you need to have a JDBC driver for your database in lib/ext, +as well as create the database schema provided in one of the +db-.sql files. diff --git a/test/code/db.properties b/test/code/db.properties index 1f8a35c7..ebceb1a3 100644 --- a/test/code/db.properties +++ b/test/code/db.properties @@ -1,5 +1,15 @@ +#MySQL dbcTest.url = jdbc:mysql://localhost/helmaTest -dbcTest.driver = org.gjt.mm.mysql.Driver +dbcTest.driver = com.mysql.jdbc.Driver dbcTest.user = helma dbcTest.password = secret + +# Oracle +# dbcTest.url = jdbc:oracle:thin:@localhost:1521:XE +# dbcTest.driver = oracle.jdbc.driver.OracleDriver + +# PostgreSQL +# dbcTest.url = jdbc:postgresql:helmaTest +# dbcTest.driver = org.postgresql.Driver + diff --git a/test/db.sql b/test/db-mysql.sql similarity index 100% rename from test/db.sql rename to test/db-mysql.sql diff --git a/test/db-oracle.sql b/test/db-oracle.sql new file mode 100644 index 00000000..817396e3 --- /dev/null +++ b/test/db-oracle.sql @@ -0,0 +1,15 @@ +CREATE TABLE tb_person ( + person_id NUMBER(10) NOT NULL, + person_name VARCHAR2(255), + person_height NUMBER(10), + person_dateofbirth DATE, + person_org_id NUMBER(10), + PRIMARY KEY (person_id) +); + +CREATE TABLE tb_organisation ( + org_id NUMBER(10) NOT NULL, + org_name VARCHAR2(255), + org_country VARCHAR2(255), + PRIMARY KEY (org_id) +); diff --git a/test/db-postgresql.sql b/test/db-postgresql.sql new file mode 100644 index 00000000..d93e9b41 --- /dev/null +++ b/test/db-postgresql.sql @@ -0,0 +1,20 @@ + +CREATE TABLE tb_person ( + person_id INTEGER NOT NULL, + person_name VARCHAR(100), + person_height INTEGER, + person_dateofbirth TIMESTAMP, + person_org_id INTEGER, + PRIMARY KEY (person_id) +); + +CREATE TABLE tb_organisation ( + org_id INTEGER NOT NULL, + org_name VARCHAR(100), + org_country VARCHAR(100), + PRIMARY KEY (org_id) +); + +CREATE USER helma WITH PASSWORD 'secret'; +GRANT insert, delete, select, update ON tb_person, tb_organisation TO helma; +