com.foundationdb.sql.jdbc.xa.FDBXADataSourceFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fdb-sql-layer-jdbc Show documentation
Show all versions of fdb-sql-layer-jdbc Show documentation
The FoundationDB SQL Layer Driver for JDBC4
/*-------------------------------------------------------------------------
*
* Copyright (c) 2007-2011, PostgreSQL Global Development Group
*
*
*-------------------------------------------------------------------------
*/
package com.foundationdb.sql.jdbc.xa;
import com.foundationdb.sql.jdbc.ds.common.*;
import javax.naming.*;
import java.util.Hashtable;
/**
* An ObjectFactory implementation for FDBXADataSource-objects.
*/
public class FDBXADataSourceFactory extends FDBObjectFactory
{
/* All the other PostgreSQL DataSource use FDBObjectFactory directly, but we
* can't do that with FDBXADataSource because referencing FDBXADataSource
* from FDBObjectFactory would break "JDBC2 Enterprise" edition build which
* doesn't include FDBXADataSource.
*/
public Object getObjectInstance(Object obj, Name name, Context nameCtx,
Hashtable environment) throws Exception
{
Reference ref = (Reference)obj;
String className = ref.getClassName();
if (className.equals("com.foundationdb.sql.jdbc.xa.FDBXADataSource"))
{
return loadXADataSource(ref);
}
else
return null;
}
private Object loadXADataSource(Reference ref)
{
FDBXADataSource ds = new FDBXADataSource();
return loadBaseDataSource(ds, ref);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy