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 javax.sql;
     19 
     20 import java.sql.SQLException;
     21 
     22 /**
     23  * An interface for the creation of {@code ConnectionPoolDataSource} objects.
     24  * Used internally within the package.
     25  * <p>
     26  * A class which implements the {@code ConnectionPoolDataSource} interface is
     27  * typically registered with a JNDI naming service directory and is retrieved
     28  * from there by name.
     29  */
     30 public interface ConnectionPoolDataSource extends CommonDataSource {
     31 
     32     /**
     33      * Creates a connection to a database which can then be used as a pooled
     34      * connection.
     35      *
     36      * @return a {@code PooledConnection} which represents the connection to the
     37      *         database.
     38      * @throws SQLException
     39      *             if there is a problem accessing the database.
     40      */
     41     public PooledConnection getPooledConnection() throws SQLException;
     42 
     43     /**
     44      * Creates a connection to a database, using the supplied user name and
     45      * password, which can then be used as a pooled connection.
     46      *
     47      * @param theUser
     48      *            the a user name for the database login.
     49      * @param thePassword
     50      *            the password associated with the user identified by {@code
     51      *            theUser}.
     52      * @return a {@code PooledConnection} object which represents the connection
     53      *         to the database.
     54      * @throws SQLException
     55      *             if there is a problem accessing the database.
     56      */
     57     public PooledConnection getPooledConnection(String theUser,
     58             String thePassword) throws SQLException;
     59 }
     60