[jboss-svn-commits] JBL Code SVN: r26418 - in labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers: modifiers and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu May 7 08:32:43 EDT 2009


Author: jhalliday
Date: 2009-05-07 08:32:42 -0400 (Thu, 07 May 2009)
New Revision: 26418

Removed:
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/cloudscape_3_6.java
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/cloudscape_3_6.java
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/firstsql_jndi.java
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/sequelink_5_1.java
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/sequelink_5_1.java
Modified:
   labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/list.java
Log:
Remove obsolete jdbc files. JBTM-546


Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/cloudscape_3_6.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/cloudscape_3_6.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/cloudscape_3_6.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,136 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2001,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: cloudscape_3_6.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package com.arjuna.ats.internal.jdbc.drivers;
-
-import com.arjuna.ats.jdbc.logging.*;
-
-import com.arjuna.ats.internal.jdbc.DynamicClass;
-
-import java.util.*;
-import java.sql.*;
-import javax.sql.*;
-import COM.cloudscape.core.DataSourceFactory;
-import COM.cloudscape.core.XaDataSource;
-import javax.sql.XADataSource;
-
-import java.sql.SQLException;
-
-/*
- * This is a stateless class to allow us access to the Cloudscape
- * specific API without hardwiring the code into the generic
- * JDBC2 driver.
- */
-
-public class cloudscape_3_6 implements DynamicClass
-{
-
-    public XADataSource getDataSource (String dbName) throws SQLException
-    {
-	return getDataSource(dbName, true);
-    }
-
-    public synchronized XADataSource getDataSource (String dbName, boolean create) throws SQLException
-    {
-	try
-	{
-	    XaDataSource xads = (COM.cloudscape.core.XaDataSource) DataSourceFactory.getXADataSource();
-	    int index1 = dbName.indexOf(cloudscape_3_6.driverName);
-
-	    if (index1 == -1)
-		throw new SQLException("cloudscape_3_6.getDataSource - "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.invaliddb")+" Cloudscape");
-	    else
-	    {
-		/*
-		 * Strip off any spurious parameters.
-		 */
-
-		int index2 = dbName.indexOf(cloudscape_3_6.semicolon);
-		String theDbName = null;
-
-		if (index2 == -1)
-		{
-		    theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length());
-		}
-		else
-		{
-		    theDbName = dbName.substring(index1+cloudscape_3_6.driverName.length(),index2);
-		}
-
-		/*
-		 * At present cloudscape does not allow remote
-		 * XA connections. So, we know the thing after the :
-		 * in the 'url' must be the database name. If this
-		 * restriction changes, we'll need to determine the
-		 * server name, port, and database name some other
-		 * way.
-		 */
-
-		xads.setDatabaseName(theDbName);
-
-		if (create)
-		    xads.setCreateDatabase("create");
-
-		return (XADataSource) xads;
-	    }
-	}
-	catch (SQLException e1)
-	{
-	    throw e1;
-	}
-	catch (Exception e2)
-	{
-        SQLException sqlException = new SQLException("cloudscape_3_6 "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.exception")+e2);
-        sqlException.initCause(e2);
-	    throw sqlException;
-	}
-    }
-
-    public synchronized void shutdownDataSource (XADataSource ds) throws SQLException
-    {
-	try
-	{
-	    XaDataSource xads = (COM.cloudscape.core.XaDataSource) ds;
-
-	    xads.setShutdownDatabase("shutdown");
-	}
-	catch (Exception e)
-	{
-        SQLException sqlException = new SQLException("cloudscape_3_6 "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.exception")+e);
-        sqlException.initCause(e);
-	    throw sqlException;
-	}
-    }
-
-    private static final String driverName = "cloudscape:";
-    private static final String semicolon = ";";
-
-}

Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/cloudscape_3_6.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/cloudscape_3_6.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/cloudscape_3_6.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,124 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 1998, 1999, 2000,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.  
- *
- * $Id: cloudscape_3_6.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package com.arjuna.ats.internal.jdbc.drivers.modifiers;
-
-import com.arjuna.ats.jta.xa.XAModifier;
-import com.arjuna.ats.jta.xa.XidImple;
-import com.arjuna.ats.jta.exceptions.NotImplementedException;
-
-import com.arjuna.ats.jdbc.logging.*;
-
-import com.arjuna.common.util.logging.*;
-
-import java.util.*;
-import java.sql.*;
-import javax.sql.*;
-import javax.transaction.xa.Xid;
-
-import java.sql.SQLException;
-
-public class cloudscape_3_6 implements XAModifier, ConnectionModifier
-{
-
-    public cloudscape_3_6 ()
-    {
-    }
-
-    public String initialise (String dbName)
-    {
-	int index = dbName.indexOf(extensions.reuseConnectionTrue);
-	int end = extensions.reuseConnectionTrue.length();
-	
-	if (index == -1)
-	{
-	    index = dbName.indexOf(extensions.reuseConnectionFalse);
-	    end = extensions.reuseConnectionFalse.length();
-	}
-
-	/*
-	 * If at start, then this must be a JNDI URL. So remove component.
-	 */
-
-	if (index != 0)
-	    return dbName;
-	else
-	    return dbName.substring(end + 1);  // remember colon
-    }
-    
-    public Xid createXid (XidImple xid) throws SQLException, NotImplementedException
-    {
-	return xid;
-    }
-
-    public XAConnection getConnection (XAConnection conn) throws SQLException, NotImplementedException
-    {
-	/*
-	 * Would like to call close on the connection here, but
-	 * for some reason Cloudscape won't let us, or at least
-	 * won't work afterwards!
-	 */
-
-	return null;
-    }
-
-    public void setIsolationLevel (Connection conn, int level) throws SQLException, NotImplementedException
-    {
-	DatabaseMetaData metaData = conn.getMetaData();
-
-	if (metaData.supportsTransactionIsolationLevel(level))
-	{
-	    try
-	    {
-		if (conn.getTransactionIsolation() != level)
-		{
-		    conn.setTransactionIsolation(level);
-		}
-	    }
-	    catch (SQLException e)
-	    {
-		if (jdbcLogger.loggerI18N.isWarnEnabled())
-		{
-		    jdbcLogger.loggerI18N.warn("com.arjuna.ats.internal.jdbc.isolationlevelfailset",
-					       new Object[] {"ConnectionImple.getConnection", e});
-		}
-
-		throw e;
-	    }
-	}
-    }
-
-    public boolean supportsMultipleConnections () throws SQLException, NotImplementedException
-    {
-	return true;
-    }
-    
-}

Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/firstsql_jndi.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/firstsql_jndi.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/firstsql_jndi.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2004,
- *
- * Arjuna Technologies Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.  
- *
- * $Id: firstsql_jndi.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package com.arjuna.ats.internal.jdbc.drivers.modifiers;
-
-import com.arjuna.ats.jta.xa.XAModifier;
-import com.arjuna.ats.jta.xa.XidImple;
-import com.arjuna.ats.jta.exceptions.NotImplementedException;
-
-import java.util.*;
-import java.sql.*;
-import javax.sql.*;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.Xid;
-
-import java.sql.SQLException;
-
-public class firstsql_jndi implements XAModifier, ConnectionModifier
-{
-
-    public String initialise (String dbName)
-    {
-	/*
-	 * If at start, then this must be a JNDI URL. So remove component.
-	 */
-
-	return dbName;
-    }
-    
-    public Xid createXid (XidImple xid) throws SQLException, NotImplementedException
-    {
-	return xid;
-    }
-
-    public int xaStartParameters (int level) throws SQLException, NotImplementedException
-    {
-	return level;
-    }
-
-    public XAConnection getConnection (XAConnection conn) throws SQLException, NotImplementedException
-    {
-	/* We don't want to call close() on the connection any more. */
-	return null;
-    }
-
-    public boolean supportsMultipleConnections () throws SQLException, NotImplementedException
-    {
-	return true;
-    }
-
-    public void setIsolationLevel (Connection conn, int level) throws SQLException, NotImplementedException
-    {
-	TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
-	Transaction tx = null;
-
-	try
-	{
-	    tx = tm.getTransaction();
-	}
-	catch (javax.transaction.SystemException se)
-	{
-	    /* Ignore: tx is null already */
-	}
-
-	if (tx != null && conn.getTransactionIsolation() != level)
-	    conn.setTransactionIsolation(level);
-    }
-    
-}

Modified: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/list.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/list.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/list.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,20 +1,20 @@
 /*
  * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
+ * Copyright 2006, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags.
  * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
+ * full listing of individual contributors.
  * This copyrighted material is made available to anyone wishing to use,
  * modify, copy, or redistribute it subject to the terms and conditions
  * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * 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,
  * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  * MA  02110-1301, USA.
- * 
+ *
  * (C) 2005-2006,
  * @author JBoss Inc.
  */
@@ -24,22 +24,18 @@
  * Arjuna Technologies Limited,
  * Newcastle upon Tyne,
  * Tyne and Wear,
- * UK.  
+ * UK.
  *
  * $Id: list.java 2342 2006-03-30 13:06:17Z  $
  */
 
 package com.arjuna.ats.internal.jdbc.drivers.modifiers;
 
-import com.arjuna.ats.internal.jdbc.drivers.modifiers.ModifierFactory;
-
 public class list
 {
 
 public list ()
     {
-	ModifierFactory.putModifier("COM.FirstSQL.Dbcp.DbcpDriver", -1, -1, "com.arjuna.ats.internal.jdbc.drivers.modifiers.firstsql_jndi");
-
 	ModifierFactory.putModifier("Oracle JDBC driver", 9, -1, "com.arjuna.ats.internal.jdbc.drivers.modifiers.oracle_jndi");
 
 	ModifierFactory.putModifier("SQLServer", 2, -1, "com.arjuna.ats.internal.jdbc.drivers.modifiers.sqlserver_jndi");
@@ -47,14 +43,8 @@
 	ModifierFactory.putModifier(oracleName, 9, 0, "com.arjuna.ats.internal.jdbc.drivers.modifiers.oracle_9_0");
 
 	ModifierFactory.putModifier(oracleName, 8, 1, "com.arjuna.ats.internal.jdbc.drivers.modifiers.oracle_8_1");
-
-	ModifierFactory.putModifier(sequelinkName, 5, 1, "com.arjuna.ats.internal.jdbc.drivers.modifiers.sequelink_5_1");
-
-	ModifierFactory.putModifier(cloudscapeName, 3, 6, "com.arjuna.ats.internal.jdbc.drivers.modifiers.cloudscape_3_6");
     }
 
 private static final String oracleName = "oracle";
-private static final String sequelinkName = "sequelink";
-private static final String cloudscapeName = "cloudscape";
-    
+
 }

Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/sequelink_5_1.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/sequelink_5_1.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/modifiers/sequelink_5_1.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,144 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors 
- * as indicated by the @author tags. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 1998, 1999, 2000,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.  
- *
- * $Id: sequelink_5_1.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package com.arjuna.ats.internal.jdbc.drivers.modifiers;
-
-import com.arjuna.ats.jta.xa.XAModifier;
-import com.arjuna.ats.jta.xa.XidImple;
-import com.arjuna.ats.jta.exceptions.NotImplementedException;
-
-import com.arjuna.ats.jdbc.logging.*;
-
-import com.arjuna.common.util.logging.*;
-
-import java.util.*;
-import java.sql.*;
-import javax.sql.*;
-import javax.transaction.xa.Xid;
-
-import java.sql.SQLException;
-
-public class sequelink_5_1 implements XAModifier, ConnectionModifier
-{
-    
-    public sequelink_5_1 ()
-    {
-	_reuseConnection = false;
-    }
-
-    public String initialise (String dbName)
-    {
-	int index = dbName.indexOf(extensions.reuseConnectionTrue);
-	int end = extensions.reuseConnectionTrue.length();
-	
-	if (index != -1)
-	    _reuseConnection  = true;
-	else
-	{
-	    index = dbName.indexOf(extensions.reuseConnectionFalse);
-	    end = extensions.reuseConnectionFalse.length();
-	}
-
-	/*
-	 * If at start, then this must be a JNDI URL. So remove component.
-	 */
-
-	if (index != 0)
-	    return dbName;
-	else
-	    return dbName.substring(end + 1);  // remember colon
-    }
-    
-    public Xid createXid (XidImple xid) throws SQLException, NotImplementedException
-    {
-	return xid;
-    }
-
-    public XAConnection getConnection (XAConnection conn) throws SQLException, NotImplementedException
-    {
-	if (_reuseConnection)
-	    return conn;
-	else
-	{
-	    if (conn != null)
-	    {
-		try
-		{
-		    conn.close();
-		}
-		catch (SQLException e)
-		{
-		}
-	    }
-	    
-	    return null;
-	}
-    }
-
-    public int xaStartParameters (int level) throws SQLException, NotImplementedException
-    {
-	return level;
-    }
-    
-    public boolean supportsMultipleConnections () throws SQLException, NotImplementedException
-    {
-	return true;
-    }
-
-    public void setIsolationLevel (Connection conn, int level) throws SQLException, NotImplementedException
-    {
-	DatabaseMetaData metaData = conn.getMetaData();
-
-	if (metaData.supportsTransactionIsolationLevel(level))
-	{
-	    try
-	    {
-		if (conn.getTransactionIsolation() != level)
-		{
-		    conn.setTransactionIsolation(level);
-		}
-	    }
-	    catch (SQLException e)
-	    {
-		if (jdbcLogger.loggerI18N.isWarnEnabled())
-		{
-		    jdbcLogger.loggerI18N.warn("com.arjuna.ats.internal.jdbc.isolationlevelfailset",
-					       new Object[] {"ConnectionImple.getConnection", e});
-		}
-
-		throw e;
-	    }
-	}
-    }
-    
-    private boolean _reuseConnection;
-    
-}

Deleted: labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/sequelink_5_1.java
===================================================================
--- labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/sequelink_5_1.java	2009-05-07 12:13:20 UTC (rev 26417)
+++ labs/jbosstm/trunk/ArjunaJTA/jdbc/classes/com/arjuna/ats/internal/jdbc/drivers/sequelink_5_1.java	2009-05-07 12:32:42 UTC (rev 26418)
@@ -1,170 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-/*
- * Copyright (C) 2001,
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: sequelink_5_1.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package com.arjuna.ats.internal.jdbc.drivers;
-
-import com.arjuna.ats.jdbc.logging.*;
-
-import com.arjuna.ats.internal.jdbc.DynamicClass;
-
-import java.util.*;
-import java.sql.*;
-import javax.sql.*;
-import com.merant.sequelink.jdbcx.datasource.SequeLinkDataSource;
-import javax.sql.XADataSource;
-
-import java.sql.SQLException;
-
-/*
- * This is a stateless class to allow us access to the Merant
- * specific API without hardwiring the code into the generic
- * JDBC2 driver.
- */
-
-public class sequelink_5_1 implements DynamicClass
-{
-
-    public sequelink_5_1 ()
-    {
-    }
-
-    public XADataSource getDataSource (String dbName) throws SQLException
-    {
-	return getDataSource(dbName, true);
-    }
-
-    public synchronized XADataSource getDataSource (String dbName, boolean create) throws SQLException
-    {
-	try
-	{
-	    SequeLinkDataSource xads = new SequeLinkDataSource();
-	    int index1 = dbName.indexOf(sequelink_5_1.driverName);
-
-	    if (index1 == -1)
-		throw new SQLException("sequelink_5_1.getDataSource - "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.invaliddb")+" Merant");
-	    else
-	    {
-		/*
-		 * Strip off any spurious parameters.
-		 */
-
-		int index2 = dbName.indexOf(sequelink_5_1.semicolon);
-		String theUrl = null;
-
-		if (index2 == -1)
-		{
-		    theUrl = dbName.substring(index1+sequelink_5_1.driverName.length());
-		}
-		else
-		{
-		    theUrl = dbName.substring(index1+sequelink_5_1.driverName.length(), index2);
-		}
-
-		/*
-		 * From the string, get the database name, the server name,
-		 * the port, etc.
-		 */
-
-		int thePort = 0;
-		String theServer = null;
-		String theDbName = null;
-
-		index1 = dbName.indexOf(sequelink_5_1.databaseName);
-
-		if (index1 != -1)
-		{
-		    index2 = dbName.indexOf(sequelink_5_1.semicolon, index1);
-
-		    if (index2 == -1)
-		    {
-			theDbName = dbName.substring(index1+sequelink_5_1.databaseName.length());
-		    }
-		    else
-		    {
-			theDbName = dbName.substring(index1+sequelink_5_1.databaseName.length(), index2);
-		    }
-		}
-
-		if (theDbName != null)
-		    xads.setDatabaseName(theDbName);
-
-		index1 = theUrl.indexOf(sequelink_5_1.colon);
-
-		if (index1 != -1)
-		{
-		    try
-		    {
-			Integer i = new Integer(theUrl.substring(index1+1));
-
-			thePort = i.intValue();
-		    }
-		    catch (Exception e)
-		    {
-                SQLException sqlException = new SQLException(e.toString());
-                sqlException.initCause(e);
-                throw sqlException;
-		    }
-
-		    theServer = theUrl.substring(0, index1);
-		}
-		else
-		{
-		    theServer = theUrl;
-		}
-
-		xads.setServerName(theServer);
-		xads.setPortNumber(thePort);
-
-		return xads;
-	    }
-	}
-	catch (SQLException e1)
-	{
-	    throw e1;
-	}
-	catch (Exception e2)
-	{
-	    SQLException sqlException = new SQLException("sequelink_5_1 "+jdbcLogger.logMesg.getString("com.arjuna.ats.internal.jdbc.drivers.exception")+e2);
-        sqlException.initCause(e2);
-        throw sqlException;
-	}
-    }
-
-    public synchronized void shutdownDataSource (XADataSource ds) throws SQLException
-    {
-    }
-
-    private static final String driverName = "sequelink://";
-    private static final String semicolon = ";";
-    private static final String colon = ":";
-    private static final String databaseName = "databaseName=";
-
-}




More information about the jboss-svn-commits mailing list