< prev index next >

src/java.sql/share/classes/java/sql/SQLPermission.java

Print this page




  41  * or the <code>Connection.abort</code> method.
  42  * If there is no <code>SQLPermission</code> object, these methods
  43  * throw a <code>java.lang.SecurityException</code> as a runtime exception.
  44  * <P>
  45  * A <code>SQLPermission</code> object contains
  46  * a name (also referred to as a "target name") but no actions
  47  * list; there is either a named permission or there is not.
  48  * The target name is the name of the permission (see below). The
  49  * naming convention follows the  hierarchical property naming convention.
  50  * In addition, an asterisk
  51  * may appear at the end of the name, following a ".", or by itself, to
  52  * signify a wildcard match. For example: <code>loadLibrary.*</code>
  53  * and <code>*</code> signify a wildcard match,
  54  * while <code>*loadLibrary</code> and <code>a*b</code> do not.
  55  * <P>
  56  * The following table lists all the possible <code>SQLPermission</code> target names.
  57  * The table gives a description of what the permission allows
  58  * and a discussion of the risks of granting code the permission.
  59  *
  60  *
  61  * <table border=1 cellpadding=5 summary="permission target name, what the permission allows, and associated risks">


  62  * <tr>
  63  * <th>Permission Target Name</th>
  64  * <th>What the Permission Allows</th>
  65  * <th>Risks of Allowing this Permission</th>
  66  * </tr>

  67  *

  68  * <tr>
  69  *   <td>setLog</td>
  70  *   <td>Setting of the logging stream</td>
  71  *   <td>This is a dangerous permission to grant.
  72  * The contents of the log may contain usernames and passwords,
  73  * SQL statements, and SQL data.</td>
  74  * </tr>
  75  * <tr>
  76  * <td>callAbort</td>
  77  *   <td>Allows the invocation of the {@code Connection} method
  78  *   {@code abort}</td>
  79  *   <td>Permits an application to terminate a physical connection to a
  80  *  database.</td>
  81  * </tr>
  82  * <tr>
  83  * <td>setSyncFactory</td>
  84  *   <td>Allows the invocation of the {@code SyncFactory} methods
  85  *   {@code setJNDIContext} and {@code setLogger}</td>
  86  *   <td>Permits an application to specify the JNDI context from which the
  87  *   {@code SyncProvider} implementations can be retrieved from and the logging
  88  *   object to be used by the {@code SyncProvider} implementation.</td>
  89  * </tr>
  90  *
  91  * <tr>
  92  * <td>setNetworkTimeout</td>
  93  *   <td>Allows the invocation of the {@code Connection} method
  94  *   {@code setNetworkTimeout}</td>
  95  *   <td>Permits an application to specify the maximum period a
  96  * <code>Connection</code> or
  97  * objects created from the <code>Connection</code>
  98  * will wait for the database to reply to any one request.</td>
  99  * <tr>
 100  * <td>deregisterDriver</td>
 101  *   <td>Allows the invocation of the {@code DriverManager}
 102  * method {@code deregisterDriver}</td>
 103  *   <td>Permits an application to remove a JDBC driver from the list of
 104  * registered Drivers and release its resources.</td>
 105  * </tr>

 106  * </table>
 107  *
 108  * @since 1.3
 109  * @see java.security.BasicPermission
 110  * @see java.security.Permission
 111  * @see java.security.Permissions
 112  * @see java.security.PermissionCollection
 113  * @see java.lang.SecurityManager
 114  *
 115  */
 116 
 117 public final class SQLPermission extends BasicPermission {
 118 
 119     /**
 120      * Creates a new <code>SQLPermission</code> object with the specified name.
 121      * The name is the symbolic name of the <code>SQLPermission</code>.
 122      *
 123      * @param name the name of this <code>SQLPermission</code> object, which must
 124      * be either {@code  setLog}, {@code callAbort}, {@code setSyncFactory},
 125      *  {@code deregisterDriver}, or {@code setNetworkTimeout}




  41  * or the <code>Connection.abort</code> method.
  42  * If there is no <code>SQLPermission</code> object, these methods
  43  * throw a <code>java.lang.SecurityException</code> as a runtime exception.
  44  * <P>
  45  * A <code>SQLPermission</code> object contains
  46  * a name (also referred to as a "target name") but no actions
  47  * list; there is either a named permission or there is not.
  48  * The target name is the name of the permission (see below). The
  49  * naming convention follows the  hierarchical property naming convention.
  50  * In addition, an asterisk
  51  * may appear at the end of the name, following a ".", or by itself, to
  52  * signify a wildcard match. For example: <code>loadLibrary.*</code>
  53  * and <code>*</code> signify a wildcard match,
  54  * while <code>*loadLibrary</code> and <code>a*b</code> do not.
  55  * <P>
  56  * The following table lists all the possible <code>SQLPermission</code> target names.
  57  * The table gives a description of what the permission allows
  58  * and a discussion of the risks of granting code the permission.
  59  *
  60  *
  61  * <table class="striped">
  62  * <caption style="display:none">permission target name, what the permission allows, and associated risks</caption>
  63  * <thead>
  64  * <tr>
  65  * <th>Permission Target Name</th>
  66  * <th>What the Permission Allows</th>
  67  * <th>Risks of Allowing this Permission</th>
  68  * </tr>
  69  * </thead>
  70  *
  71  * <tbody>
  72  * <tr>
  73  *   <td>setLog</td>
  74  *   <td>Setting of the logging stream</td>
  75  *   <td>This is a dangerous permission to grant.
  76  * The contents of the log may contain usernames and passwords,
  77  * SQL statements, and SQL data.</td>
  78  * </tr>
  79  * <tr>
  80  * <td>callAbort</td>
  81  *   <td>Allows the invocation of the {@code Connection} method
  82  *   {@code abort}</td>
  83  *   <td>Permits an application to terminate a physical connection to a
  84  *  database.</td>
  85  * </tr>
  86  * <tr>
  87  * <td>setSyncFactory</td>
  88  *   <td>Allows the invocation of the {@code SyncFactory} methods
  89  *   {@code setJNDIContext} and {@code setLogger}</td>
  90  *   <td>Permits an application to specify the JNDI context from which the
  91  *   {@code SyncProvider} implementations can be retrieved from and the logging
  92  *   object to be used by the {@code SyncProvider} implementation.</td>
  93  * </tr>
  94  *
  95  * <tr>
  96  * <td>setNetworkTimeout</td>
  97  *   <td>Allows the invocation of the {@code Connection} method
  98  *   {@code setNetworkTimeout}</td>
  99  *   <td>Permits an application to specify the maximum period a
 100  * <code>Connection</code> or
 101  * objects created from the <code>Connection</code>
 102  * will wait for the database to reply to any one request.</td>
 103  * <tr>
 104  * <td>deregisterDriver</td>
 105  *   <td>Allows the invocation of the {@code DriverManager}
 106  * method {@code deregisterDriver}</td>
 107  *   <td>Permits an application to remove a JDBC driver from the list of
 108  * registered Drivers and release its resources.</td>
 109  * </tr>
 110  * </tbody>
 111  * </table>
 112  *
 113  * @since 1.3
 114  * @see java.security.BasicPermission
 115  * @see java.security.Permission
 116  * @see java.security.Permissions
 117  * @see java.security.PermissionCollection
 118  * @see java.lang.SecurityManager
 119  *
 120  */
 121 
 122 public final class SQLPermission extends BasicPermission {
 123 
 124     /**
 125      * Creates a new <code>SQLPermission</code> object with the specified name.
 126      * The name is the symbolic name of the <code>SQLPermission</code>.
 127      *
 128      * @param name the name of this <code>SQLPermission</code> object, which must
 129      * be either {@code  setLog}, {@code callAbort}, {@code setSyncFactory},
 130      *  {@code deregisterDriver}, or {@code setNetworkTimeout}


< prev index next >