/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.org
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Initial developer(s): ____________________________________.
 * Contributor(s): ______________________________________.
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.dbm;

import org.enhydra.jdbc.instantdb.IdbXADataSource;
import javax.transaction.TransactionManager;
import java.sql.SQLException;

/**
 * CAUTION : this wrapper only works with InstantDB 3.21 version
 * with XA support
 *
 * To compile this file, you have to add it in the local Makefile
 * and add in your classpath, the idb.jar from instantDB.
 * (org.enhydra.jdbc.instantdb.IdbXADataSource is needed to compile
 * this file)
 */
public class JonasIdbXADataSource extends IdbXADataSource implements CommonDataSource {

    public void setProperties(String url, String classname, String user, String password) throws SQLException {
	setUrl(url);
	try {
	    setDriverName(classname);
	} catch (Exception e) {
	    log("Exception JonasIdbXADataSource:setProperties "+e);
	    throw new SQLException("Exception JonasIdbXADataSource:setProperties ");
	}
	setUser(user);
	setPassword(password);

    } // method setProperties

    
    public void setTransactionManager(TransactionManager tm) {
	super.setTransactionManager(tm);
    } // method setTransactionManager

    public void setMinCon(int min) {
	super.setMinCon(min);
    } // method setMinCon

    public void setMaxCon(int min) {
	super.setMaxCon(min);
    } // method setMaxCon

} // class JonasIdbXADataSource
