/*
 * 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 java.sql.SQLException;
import javax.naming.Context;
import javax.naming.Name;
import javax.naming.NamingException;
import javax.naming.Reference;
import javax.naming.Referenceable;
import javax.naming.StringRefAddr;
import javax.naming.spi.ObjectFactory;
import java.io.PrintWriter;
import java.util.Hashtable;
import javax.transaction.TransactionManager;
import org.enhydra.jdbc.oracle.OracleXADataSource;

/**
 * To compile this class, you must have the classes12.zip file
 * from Oracle (driver JDBC 2.0 with Oracle 8.1.6 version), 
 * and add the current file to the build mechanism (Makefile)
 *
 * We have to use specific method from oracle driver to set up	
 * the user name of the DB.
 * The driverName (see StandardDataSource) is not used. We supposed
 * that the driver does the work for us.
 * We have to define getReference and getObjectInstance for JNDI
 * lookup in the poolDataSource (xa)
 */
public class JonasOracleXADataSource extends OracleXADataSource implements Referenceable, ObjectFactory, CommonDataSource {


    public JonasOracleXADataSource () throws SQLException {
	super();
    }

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

 } //class JonasOracleXADataSource
