PL/Java is a free add-on module that brings Java™ Stored Procedures, Triggers, Functions, Aggregates, Operators, Types, etc., to the PostgreSQL™ backend.
Issue exists while trying to call a DB function that calls a java function by reading the file name.
Getting the Following error.
SQL Error [42501]: ERROR: java.sql.SQLSyntaxErrorException: access denied ("java.io.FilePermission" "/path/fileName.txt" "read")
pljava version used: 2-SNAPSHOT
java version :11.0.17
postgres version:13
Added the following to pljava.policy file
grant principal org.postgresql.pljava.PLPrincipal$Sandboxed "java" {
};
grant principal org.postgresql.pljava.PLPrincipal$Unsandboxed "javaU" {
permission java.io.FilePermission
"<>", "read,readlink,write,delete";
};
grant codebase "sqlj:testapp" {
permission java.util.PropertyPermission "user.timezone", "write";
};
grant {
permission java.util.PropertyPermission
"sqlj.defaultconnection", "read";
};
grant {
permission java.security.AllPermission;
};
Issue exists while trying to call a DB function that calls a java function by reading the file name. Getting the Following error. SQL Error [42501]: ERROR: java.sql.SQLSyntaxErrorException: access denied ("java.io.FilePermission" "/path/fileName.txt" "read")
pljava version used: 2-SNAPSHOT java version :11.0.17 postgres version:13
Added the following to pljava.policy file
grant principal org.postgresql.pljava.PLPrincipal$Sandboxed "java" { };
grant principal org.postgresql.pljava.PLPrincipal$Unsandboxed "javaU" { permission java.io.FilePermission "<>", "read,readlink,write,delete";
};
grant codebase "sqlj:testapp" {
permission java.util.PropertyPermission "user.timezone", "write";
};
grant {
permission java.util.PropertyPermission
"sqlj.defaultconnection", "read";
};
grant {
permission java.security.AllPermission;
};