JDBC 驱动程序连接需要什么权限?
What permission is needed for a JDBC driver connection?
外部代码打包在 jar
文件中。它包含以下简单代码
Class.forName("com.teradata.jdbc.TeraDriver");
Connection con = DriverManager.getConnection(url, user, password);
这个 jar 从沙箱运行。
当我实施 AllPermission
时效果很好
Permissions permissions = new Permissions();
permissions.add(new AllPermission));
但是当我施加限制时它会抛出错误
Caused by: java.lang.NullPointerException
at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)
这是我使用的权限列表
Permissions permissions = new Permissions();
permissions.add(new FilePermission(filePermission, "read,write,delete"));
permissions.add(new PropertyPermission("*", "read,write"));
permissions.add(new SocketPermission("*", "connect,resolve"));
permissions.add(new NetPermission("setDefaultAuthenticator,requestPasswordAuthentication"));
permissions.add(new SerializablePermission("enableSubstitution,enableSubclassImplementation"));
permissions.add(new ReflectPermission("suppressAccessChecks"));
// what permission is missing for the JDBC to work?
JDBC 驱动程序需要什么其他权限才能工作?
根据 Oracle blog 关于 JDBC 的安全性,有很多权限需要设置。
可能缺少SQLPermission
,其他的需要弄清楚。 @Andreas 提供了一篇很棒的文章 on troubleshooting security 来做到这一点。
外部代码打包在 jar
文件中。它包含以下简单代码
Class.forName("com.teradata.jdbc.TeraDriver");
Connection con = DriverManager.getConnection(url, user, password);
这个 jar 从沙箱运行。
当我实施 AllPermission
Permissions permissions = new Permissions();
permissions.add(new AllPermission));
但是当我施加限制时它会抛出错误
Caused by: java.lang.NullPointerException
at com.teradata.tdgss.jtdgss.TdgssConfigApi.GetMechanisms(Unknown Source)
这是我使用的权限列表
Permissions permissions = new Permissions();
permissions.add(new FilePermission(filePermission, "read,write,delete"));
permissions.add(new PropertyPermission("*", "read,write"));
permissions.add(new SocketPermission("*", "connect,resolve"));
permissions.add(new NetPermission("setDefaultAuthenticator,requestPasswordAuthentication"));
permissions.add(new SerializablePermission("enableSubstitution,enableSubclassImplementation"));
permissions.add(new ReflectPermission("suppressAccessChecks"));
// what permission is missing for the JDBC to work?
JDBC 驱动程序需要什么其他权限才能工作?
根据 Oracle blog 关于 JDBC 的安全性,有很多权限需要设置。
可能缺少SQLPermission
,其他的需要弄清楚。 @Andreas 提供了一篇很棒的文章 on troubleshooting security 来做到这一点。