View Javadoc

1   /*
2    * Copyright 2002-2004 the original author or authors.
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */ 
16  
17  package org.jencks.tranql;
18  
19  import java.sql.SQLException;
20  
21  import org.enhydra.jdbc.standard.StandardXADataSource;
22  import org.tranql.connector.AllExceptionsAreFatalSorter;
23  import org.tranql.connector.jdbc.AbstractXADataSourceMCF;
24  
25  /***
26   * @author Thierry Templier
27   */
28  public class XAPoolDataSourceMCF extends AbstractXADataSourceMCF {
29  
30  	public XAPoolDataSourceMCF() {
31  		super(new StandardXADataSource(),new AllExceptionsAreFatalSorter());
32  	}
33  
34  	/***
35  	 * @see org.tranql.connector.UserPasswordManagedConnectionFactory#getUserName()
36  	 */
37  	public String getUserName() {
38  		return ((StandardXADataSource)xaDataSource).getUser();
39  	}
40  
41  	/***
42  	 * @see org.tranql.connector.UserPasswordManagedConnectionFactory#getPassword()
43  	 */
44  	public String getPassword() {
45  		return ((StandardXADataSource)xaDataSource).getPassword();
46  	}
47  
48  	/*
49  	 * 
50  	 */
51  	public void setDriverName(String driverName) {
52  		try {
53  			((StandardXADataSource)xaDataSource).setDriverName(driverName);
54  		} catch (SQLException ex) {
55  			ex.printStackTrace();
56  		}
57      }
58  
59  	public void setUrl(String url) {
60  		((StandardXADataSource)xaDataSource).setUrl(url);
61  	}
62  
63  	public void setUser(String user) {
64  		((StandardXADataSource)xaDataSource).setUser(user);
65  	}
66  
67  	public void setPassword(String password) {
68  		((StandardXADataSource)xaDataSource).setPassword(password);
69  	}
70  
71  }