Home | History | Annotate | Download | only in sql
      1 /*
      2  * Licensed to the Apache Software Foundation (ASF) under one or more
      3  * contributor license agreements.  See the NOTICE file distributed with
      4  * this work for additional information regarding copyright ownership.
      5  * The ASF licenses this file to You under the Apache License, Version 2.0
      6  * (the "License"); you may not use this file except in compliance with
      7  * the License.  You may obtain a copy of the License at
      8  *
      9  *     http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  * Unless required by applicable law or agreed to in writing, software
     12  * distributed under the License is distributed on an "AS IS" BASIS,
     13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  * See the License for the specific language governing permissions and
     15  * limitations under the License.
     16  */
     17 
     18 package java.sql;
     19 
     20 import java.io.Serializable;
     21 import java.security.BasicPermission;
     22 import java.security.Guard;
     23 
     24 /**
     25  * A Permission relating to security access control in the {@code java.sql}
     26  * package.
     27  * <p>
     28  * Currently, the only permission supported has the name " {@code setLog}". The
     29  * {@code setLog} permission controls whether a Java application or applet can
     30  * open a logging stream using the {@code DriverManager.setLogWriter} method or
     31  * the {@code DriverManager.setLogStream} method. This is a potentially
     32  * dangerous operation since the logging stream can contain sensitive
     33  * information such as usernames and passwords.
     34  *
     35  * @see DriverManager
     36  */
     37 public final class SQLPermission extends BasicPermission implements Guard,
     38         Serializable {
     39 
     40     private static final long serialVersionUID = -1439323187199563495L;
     41 
     42     /**
     43      * Creates a new {@code SQLPermission} object with the specified name.
     44      *
     45      * @param name
     46      *            the name to use for this {@code SQLPermission}.
     47      */
     48     public SQLPermission(String name) {
     49         super(name);
     50     }
     51 
     52     /**
     53      * Creates a new {@code SQLPermission} object with the specified name.
     54      *
     55      * @param name
     56      *            is the name of the {@code SQLPermission}. Currently only
     57      *            {@code "setLog"} is allowed.
     58      * @param actions
     59      *            is currently unused and should be set to {@code null}.
     60      */
     61     public SQLPermission(String name, String actions) {
     62         super(name, null);
     63     }
     64 }
     65