Author: vhalbert(a)redhat.com
Date: 2009-11-16 16:08:22 -0500 (Mon, 16 Nov 2009)
New Revision: 1566
Removed:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java
Log:
Teiid 773 - refactored back in the way jbedsp transaction classes where defined
Deleted:
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java
===================================================================
---
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java 2009-11-16
21:07:42 UTC (rev 1565)
+++
trunk/test-integration/db/src/main/java/org/teiid/test/framework/connection/ConnectionUtil.java 2009-11-16
21:08:22 UTC (rev 1566)
@@ -1,54 +0,0 @@
-package org.teiid.test.framework.connection;
-
-import java.sql.Connection;
-import java.util.Map;
-
-import javax.sql.XAConnection;
-
-import org.teiid.test.framework.datasource.DataSource;
-import org.teiid.test.framework.exception.QueryTestFailedException;
-import org.teiid.test.framework.exception.TransactionRuntimeException;
-
-// identifier should be the model name that is identfied in the config properties
-public class ConnectionUtil {
- public static final Connection getConnection(String identifier, Map<String,
DataSource> datasources, ConnectionStrategy connstrategy) throws
QueryTestFailedException {
- DataSource ds = null;
- if (identifier != null) {
- ds = datasources.get(identifier);
- if (ds == null) {
- throw new TransactionRuntimeException("DataSource is not mapped to Identifier
"
- + identifier);
- }
-
- }
-
- Connection conn = connstrategy.createDriverStrategy(identifier,
- ds.getProperties()).getConnection();
- // force autocommit back to true, just in case the last user didnt
- try {
- conn.setAutoCommit(true);
- } catch (Exception sqle) {
- throw new QueryTestFailedException(sqle);
- }
-
- return conn;
-
- }
-
- public static final XAConnection getXAConnection(String identifier, Map<String,
DataSource> datasources, ConnectionStrategy connstrategy) throws
QueryTestFailedException {
- DataSource ds = null;
- if (identifier != null) {
- ds = datasources.get(identifier);
- if (ds == null) {
- throw new TransactionRuntimeException("DataSource is not mapped to Identifier
"
- + identifier);
- }
-
- }
-
- return connstrategy.createDataSourceStrategy(
- identifier, ds.getProperties()).getXAConnection();
-
- }
-
-}