01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * 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 org.apache.commons.dbcp.datasources;
19:
20: import javax.sql.PooledConnection;
21:
22: /**
23: * @version $Revision: 479137 $ $Date: 2006-11-25 08:51:48 -0700 (Sat, 25 Nov 2006) $
24: */
25: final class PooledConnectionAndInfo {
26: private final PooledConnection pooledConnection;
27: private final String password;
28: private final String username;
29: private final UserPassKey upkey;
30:
31: PooledConnectionAndInfo(PooledConnection pc, String username,
32: String password) {
33: this .pooledConnection = pc;
34: this .username = username;
35: this .password = password;
36: upkey = new UserPassKey(username, password);
37: }
38:
39: final PooledConnection getPooledConnection() {
40: return pooledConnection;
41: }
42:
43: final UserPassKey getUserPassKey() {
44: return upkey;
45: }
46:
47: /**
48: * Get the value of password.
49: * @return value of password.
50: */
51: final String getPassword() {
52: return password;
53: }
54:
55: /**
56: * Get the value of username.
57: * @return value of username.
58: */
59: final String getUsername() {
60: return username;
61: }
62: }
|