001 /* 002 * Copyright 2002-2004 the original author or authors. 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016 017 package org.jencks.tranql; 018 019 import java.sql.SQLException; 020 021 import org.enhydra.jdbc.standard.StandardXADataSource; 022 import org.tranql.connector.AllExceptionsAreFatalSorter; 023 import org.tranql.connector.jdbc.AbstractXADataSourceMCF; 024 025 /** 026 * @author Thierry Templier 027 */ 028 public class XAPoolDataSourceMCF extends AbstractXADataSourceMCF { 029 030 public XAPoolDataSourceMCF() { 031 super(new StandardXADataSource(),new AllExceptionsAreFatalSorter()); 032 } 033 034 /** 035 * @see org.tranql.connector.UserPasswordManagedConnectionFactory#getUserName() 036 */ 037 public String getUserName() { 038 return ((StandardXADataSource)xaDataSource).getUser(); 039 } 040 041 /** 042 * @see org.tranql.connector.UserPasswordManagedConnectionFactory#getPassword() 043 */ 044 public String getPassword() { 045 return ((StandardXADataSource)xaDataSource).getPassword(); 046 } 047 048 /* 049 * 050 */ 051 public void setDriverName(String driverName) { 052 try { 053 ((StandardXADataSource)xaDataSource).setDriverName(driverName); 054 } catch (SQLException ex) { 055 ex.printStackTrace(); 056 } 057 } 058 059 public void setUrl(String url) { 060 ((StandardXADataSource)xaDataSource).setUrl(url); 061 } 062 063 public void setUser(String user) { 064 ((StandardXADataSource)xaDataSource).setUser(user); 065 } 066 067 public void setPassword(String password) { 068 ((StandardXADataSource)xaDataSource).setPassword(password); 069 } 070 071 }