- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- java.sql.SQLPermission
-
- All Implemented Interfaces:
-
Serializable,Guard
public final class SQLPermission extends BasicPermission
在启用SecurityManager的应用程序的代码的情况下,SecurityManager将检查的权限,调用DriverManager.deregisterDriver方法,DriverManager.setLogWriter方法,DriverManager.setLogStream(弃用)方法,SyncFactory.setJNDIContext方法,SyncFactory.setLogger方法,Connection.setNetworkTimeout方法或Connection.abort方法。 如果没有SQLPermission对象,这些方法会抛出一个java.lang.SecurityException作为运行时异常。一个
SQLPermission对象包含一个名称(也称为“目标名称”),但没有动作列表; 有一个命名的权限或没有。 目标名称是权限的名称(见下文)。 命名约定遵循层次化属性命名约定。 另外,星号可能会出现在名称的末尾,遵循“。”或本身表示通配符匹配。 例如:loadLibrary.*和*表示通配符匹配,而*loadLibrary和a*b不。下表列出了所有可能的
permission target name, what the permission allows, and associated risks Permission Target Name What the Permission Allows Risks of Allowing this Permission setLog Setting of the logging stream This is a dangerous permission to grant. The contents of the log may contain usernames and passwords, SQL statements, and SQL data. callAbort Allows the invocation of theSQLPermission目标名称。 该表给出了许可允许的描述以及授权许可的风险的讨论。ConnectionmethodabortPermits an application to terminate a physical connection to a database. setSyncFactory Allows the invocation of theSyncFactorymethodssetJNDIContextandsetLoggerPermits an application to specify the JNDI context from which theSyncProviderimplementations can be retrieved from and the logging object to be used by theSyncProviderimplementation. setNetworkTimeout Allows the invocation of theConnectionmethodsetNetworkTimeoutPermits an application to specify the maximum period aConnectionor objects created from theConnectionwill wait for the database to reply to any one request. deregisterDriver Allows the invocation of theDriverManagermethodderegisterDriverPermits an application to remove a JDBC driver from the list of registered Drivers and release its resources.- 从以下版本开始:
- 1.3
- 另请参见:
-
BasicPermission,Permission,Permissions,PermissionCollection,SecurityManager, Serialized Form
-
-
构造方法摘要
构造方法 Constructor 描述 SQLPermission(String name)使用指定的名称创建一个新的SQLPermission对象。SQLPermission(String name, String actions)使用指定的名称创建一个新的SQLPermission对象。
-
方法摘要
-
Methods inherited from class java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from class java.security.Permission
checkGuard, getName, toString
-
-
-
-
构造方法详细信息
-
SQLPermission
public SQLPermission(String name)
创建一个新的指定名称的SQLPermission对象。 名称是SQLPermission的符号名称。- 参数
-
name-此的名称SQLPermission对象,它必须是setLog,callAbort,setSyncFactory,deregisterDriver,或setNetworkTimeout - 异常
-
NullPointerException- 如果name是null。 -
IllegalArgumentException- 如果name为空。
-
SQLPermission
public SQLPermission(String name, String actions)
使用指定的名称创建一个新的SQLPermission对象。 名称是SQLPermission的象征名称; 操作String当前未使用,应为null。- 参数
-
name-此的名称SQLPermission对象,它必须是setLog,callAbort,setSyncFactory,deregisterDriver,或setNetworkTimeout -
actions- 应为null - 异常
-
NullPointerException- 如果name是null。 -
IllegalArgumentException- 如果name为空。
-
-