- java.lang.Object
-
- java.security.Permission
-
- java.security.BasicPermission
-
- java.sql.SQLPermission
-
- 实现的所有接口
-
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
-
-
构造方法摘要
构造方法 构造器 描述 SQLPermission(String name)创建具有指定名称的新SQLPermission对象。SQLPermission(String name, String actions)创建具有指定名称的新SQLPermission对象。
-
方法摘要
-
声明方法的类 java.security.BasicPermission
equals, getActions, hashCode, implies, newPermissionCollection
-
声明方法的类 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为空。
-
-