diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
index 50ed4d1..50dbbeb 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
@@ -46,6 +46,7 @@
 import edu.uci.ics.hyracks.algebricks.core.api.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.core.utils.Pair;
 import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 
 /**
@@ -61,6 +62,7 @@
 
     private static final int RESULT_BUF_SIZE = 8192;
 
+    private final IHyracksClientConnection hcc;
     private final ICCApplicationContext appContext;
     private final AQLJStream clientStream;
     private final String outputFilePath;
@@ -72,7 +74,9 @@
     private int nodeDataServerPort;
     private String dataverse;
 
-    public APIClientThread(Socket clientSocket, ICCApplicationContext appCtx) throws IOException {
+    public APIClientThread(IHyracksClientConnection hcc, Socket clientSocket, ICCApplicationContext appCtx)
+            throws IOException {
+        this.hcc = hcc;
         clientStream = new AQLJStream(clientSocket);
         this.appContext = appCtx;
 
@@ -230,15 +234,14 @@
             if (q != null) {
                 String dataverse = APIFramework.compileDdlStatements(q, out, pc, DisplayFormat.TEXT);
                 Job[] dmlJobs = APIFramework.compileDmlStatements(dataverse, q, out, pc, DisplayFormat.TEXT);
-                APIFramework.executeJobArray(dmlJobs, pc.getPort(), out, DisplayFormat.TEXT);
+                APIFramework.executeJobArray(hcc, dmlJobs, out, DisplayFormat.TEXT);
             }
 
             Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(
                     dataverse, q, parser.getVarCounter(), null, metadata, pc, out, DisplayFormat.TEXT, null);
             JobSpecification spec = metadataAndSpec.second;
             metadata = metadataAndSpec.first;
-            APIFramework.executeJobArray(new JobSpecification[] { spec },
-                    AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, out, DisplayFormat.TEXT);
+            APIFramework.executeJobArray(hcc, new JobSpecification[] { spec }, out, DisplayFormat.TEXT);
         } catch (ParseException e) {
             e.printStackTrace();
             throw new AQLJException(e);
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThreadFactory.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThreadFactory.java
index 36f049c..682d774 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThreadFactory.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThreadFactory.java
@@ -18,6 +18,8 @@
 import java.net.Socket;
 
 import edu.uci.ics.hyracks.api.application.ICCApplicationContext;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 
 /**
  * This class is a factory for client handler threads of type {@link APIClientThread} and is used in conjunction with {@link ThreadedServer}.
@@ -27,12 +29,16 @@
 public class APIClientThreadFactory implements IClientThreadFactory {
     private final ICCApplicationContext appContext;
 
-    public APIClientThreadFactory(ICCApplicationContext appContext) {
+    private IHyracksClientConnection hcc;
+
+    public APIClientThreadFactory(ICCApplicationContext appContext) throws Exception {
         this.appContext = appContext;
+        hcc = new HyracksConnection("localhost", appContext.getCCContext().getClusterControllerInfo()
+                .getClientNetPort());
     }
 
     @Override
     public Thread createThread(Socket socket) throws IOException {
-        return new APIClientThread(socket, appContext);
+        return new APIClientThread(hcc, socket, appContext);
     }
 }
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
index e060146..6157775 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
@@ -548,10 +548,8 @@
         return new Pair<AqlCompiledMetadataDeclarations, JobSpecification>(metadataDecls, spec);
     }
 
-    public static void executeJobArray(JobSpecification[] specs, int port, PrintWriter out, DisplayFormat pdf)
+    public static void executeJobArray(IHyracksClientConnection hcc, JobSpecification[] specs, PrintWriter out, DisplayFormat pdf)
             throws Exception {
-        IHyracksClientConnection hcc = new HyracksConnection("localhost", port);
-
         for (int i = 0; i < specs.length; i++) {
             specs[i].setMaxReattempts(0);
             JobId jobId = hcc.createJob(GlobalConfig.HYRACKS_APP_NAME, specs[i]);
@@ -565,9 +563,8 @@
 
     }
 
-    public static void executeJobArray(Job[] jobs, int port, PrintWriter out, DisplayFormat pdf) throws Exception {
-        IHyracksClientConnection hcc = new HyracksConnection("localhost", port);
-
+    public static void executeJobArray(IHyracksClientConnection hcc, Job[] jobs, PrintWriter out, DisplayFormat pdf)
+            throws Exception {
         for (int i = 0; i < jobs.length; i++) {
             jobs[i].getJobSpec().setMaxReattempts(0);
             JobId jobId = hcc.createJob(GlobalConfig.HYRACKS_APP_NAME, jobs[i].getJobSpec());
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
index 4e9f3ef..5f4c189 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/AsterixHyracksIntegrationUtil.java
@@ -31,8 +31,8 @@
 
     public static void init() throws Exception {
         CCConfig ccConfig = new CCConfig();
-        ccConfig.clusterNetIpAddress="127.0.0.1";
-        ccConfig.clientNetIpAddress="127.0.0.1";
+        ccConfig.clusterNetIpAddress = "127.0.0.1";
+        ccConfig.clientNetIpAddress = "127.0.0.1";
         ccConfig.clientNetPort = DEFAULT_HYRACKS_CC_CLIENT_PORT;
         ccConfig.clusterNetPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
         ccConfig.defaultMaxJobAttempts = 0;
@@ -43,7 +43,7 @@
         NCConfig ncConfig1 = new NCConfig();
         ncConfig1.ccHost = "localhost";
         ncConfig1.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
-        ncConfig1.clusterNetIPAddress="127.0.0.1";
+        ncConfig1.clusterNetIPAddress = "127.0.0.1";
         ncConfig1.dataIPAddress = "127.0.0.1";
         ncConfig1.nodeId = NC1_ID;
         ncConfig1.frameSize = FRAME_SIZE;
@@ -53,7 +53,7 @@
         NCConfig ncConfig2 = new NCConfig();
         ncConfig2.ccHost = "localhost";
         ncConfig2.ccPort = DEFAULT_HYRACKS_CC_CLUSTER_PORT;
-        ncConfig2.clusterNetIPAddress="127.0.0.1";
+        ncConfig2.clusterNetIPAddress = "127.0.0.1";
         ncConfig2.dataIPAddress = "127.0.0.1";
         ncConfig2.nodeId = NC2_ID;
         ncConfig2.frameSize = FRAME_SIZE;
@@ -65,6 +65,10 @@
 
     }
 
+    public static IHyracksClientConnection getHyracksClientConnection() {
+        return hcc;
+    }
+
     public static void destroyApp() throws Exception {
         hcc.destroyApplication(GlobalConfig.HYRACKS_APP_NAME);
     }
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
index b74f8a7..1e807a2 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
@@ -7,6 +7,7 @@
 import java.io.PrintWriter;
 import java.io.StringReader;
 
+import javax.servlet.ServletContext;
 import javax.servlet.http.HttpServlet;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
@@ -22,11 +23,15 @@
 import edu.uci.ics.asterix.metadata.MetadataManager;
 import edu.uci.ics.asterix.metadata.declared.AqlCompiledMetadataDeclarations;
 import edu.uci.ics.hyracks.algebricks.core.utils.Pair;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 
 public class APIServlet extends HttpServlet {
     private static final long serialVersionUID = 1L;
 
+    private static final String HYRACKS_CONNECTION_ATTR = "edu.uci.ics.asterix.HYRACKS_CONNECTION";
+
     @Override
     public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
         String query = request.getParameter("query");
@@ -42,7 +47,16 @@
         response.setContentType("text/html");
         out.println("<H1>Input statements:</H1>");
         printInHtml(out, query);
+        ServletContext context = getServletContext();
+        IHyracksClientConnection hcc;
         try {
+            synchronized (context) {
+                hcc = (IHyracksClientConnection) context.getAttribute(HYRACKS_CONNECTION_ATTR);
+                if (hcc == null) {
+                    hcc = new HyracksConnection("localhost", port);
+                    context.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
+                }
+            }
             AQLParser parser = new AQLParser(new StringReader(query));
             Query q = (Query) parser.Statement();
             SessionConfig pc = new SessionConfig(port, true, isSet(printExprParam), isSet(printRewrittenExprParam),
@@ -50,10 +64,10 @@
             pc.setGenerateJobSpec(true);
 
             MetadataManager.INSTANCE.init();
-            String  dataverseName = null;
+            String dataverseName = null;
 
             if (q != null) {
-                dataverseName = postDmlStatement(q, out, pc);
+                dataverseName = postDmlStatement(hcc, q, out, pc);
             }
 
             if (q.isDummyQuery()) {
@@ -66,7 +80,7 @@
             GlobalConfig.ASTERIX_LOGGER.info(spec.toJSON().toString(1));
             AqlCompiledMetadataDeclarations metadata = metadataAndSpec.first;
             long startTime = System.currentTimeMillis();
-            APIFramework.executeJobArray(new JobSpecification[] { spec }, port, out, DisplayFormat.HTML);
+            APIFramework.executeJobArray(hcc, new JobSpecification[] { spec }, out, DisplayFormat.HTML);
             long endTime = System.currentTimeMillis();
             double duration = (endTime - startTime) / 1000.00;
             out.println("<H1>Result:</H1>");
@@ -119,13 +133,14 @@
         out.println(form);
     }
 
-    private String postDmlStatement(Query dummyQ, PrintWriter out, SessionConfig pc) throws Exception {
+    private String postDmlStatement(IHyracksClientConnection hcc, Query dummyQ, PrintWriter out, SessionConfig pc)
+            throws Exception {
 
         String dataverseName = APIFramework.compileDdlStatements(dummyQ, out, pc, DisplayFormat.TEXT);
         Job[] dmlJobSpecs = APIFramework.compileDmlStatements(dataverseName, dummyQ, out, pc, DisplayFormat.HTML);
 
         long startTime = System.currentTimeMillis();
-        APIFramework.executeJobArray(dmlJobSpecs, pc.getPort(), out, DisplayFormat.HTML);
+        APIFramework.executeJobArray(hcc, dmlJobSpecs, out, DisplayFormat.HTML);
         long endTime = System.currentTimeMillis();
         double duration = (endTime - startTime) / 1000.00;
         out.println("<PRE>Duration of all jobs: " + duration + "</PRE>");
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
index 0f5059a..78c5a8d 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
@@ -20,24 +20,25 @@
 import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
 import edu.uci.ics.hyracks.algebricks.core.api.exceptions.AlgebricksException;
 import edu.uci.ics.hyracks.algebricks.core.utils.Pair;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 
 public class AsterixJavaClient {
-
+    private IHyracksClientConnection hcc;
     private Reader queryText;
     private PrintWriter writer;
 
     private Job[] dmlJobs;
     private JobSpecification queryJobSpec;
 
-    public AsterixJavaClient(Reader queryText, PrintWriter writer) {
+    public AsterixJavaClient(IHyracksClientConnection hcc, Reader queryText, PrintWriter writer) {
+        this.hcc = hcc;
         this.queryText = queryText;
         this.writer = writer;
     }
 
-    public AsterixJavaClient(Reader queryText) {
-        this.queryText = queryText;
-        this.writer = new PrintWriter(System.out, true);
+    public AsterixJavaClient(IHyracksClientConnection hcc, Reader queryText) {
+        this(hcc, queryText, new PrintWriter(System.out, true));
     }
 
     public void compile() throws Exception {
@@ -62,13 +63,13 @@
         }
         MetadataManager.INSTANCE.init();
 
-        SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, optimize, false,
-                printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly, printJob);
+        SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, optimize,
+                false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly, printJob);
         pc.setGenerateJobSpec(generateBinaryRuntime);
 
         String dataverseName = null;
         if (q != null) {
-            dataverseName =  APIFramework.compileDdlStatements(q, writer, pc, DisplayFormat.TEXT);
+            dataverseName = APIFramework.compileDdlStatements(q, writer, pc, DisplayFormat.TEXT);
             dmlJobs = APIFramework.compileDmlStatements(dataverseName, q, writer, pc, DisplayFormat.TEXT);
         }
 
@@ -76,20 +77,20 @@
             return;
         }
 
-        Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(dataverseName, q,
-                parser.getVarCounter(), null, null, pc, writer, DisplayFormat.TEXT, null);
+        Pair<AqlCompiledMetadataDeclarations, JobSpecification> metadataAndSpec = APIFramework.compileQuery(
+                dataverseName, q, parser.getVarCounter(), null, null, pc, writer, DisplayFormat.TEXT, null);
         if (metadataAndSpec != null) {
             queryJobSpec = metadataAndSpec.second;
         }
         writer.flush();
     }
 
-    public void execute(int port) throws Exception {
+    public void execute() throws Exception {
         if (dmlJobs != null) {
-            APIFramework.executeJobArray(dmlJobs, port, writer, DisplayFormat.TEXT);
+            APIFramework.executeJobArray(hcc, dmlJobs, writer, DisplayFormat.TEXT);
         }
         if (queryJobSpec != null) {
-            APIFramework.executeJobArray(new JobSpecification[] { queryJobSpec }, port, writer, DisplayFormat.TEXT);
+            APIFramework.executeJobArray(hcc, new JobSpecification[] { queryJobSpec }, writer, DisplayFormat.TEXT);
         }
     }
 
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/drivers/AsterixClientDriver.java b/asterix-app/src/main/java/edu/uci/ics/asterix/drivers/AsterixClientDriver.java
index db04380..1a61059 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/drivers/AsterixClientDriver.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/drivers/AsterixClientDriver.java
@@ -6,6 +6,8 @@
 
 import edu.uci.ics.asterix.api.common.AsterixClientConfig;
 import edu.uci.ics.asterix.api.java.AsterixJavaClient;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 
 public class AsterixClientDriver {
 
@@ -29,17 +31,18 @@
             return;
         }
         boolean exec = new Boolean(acc.execute);
-        AsterixJavaClient q = compileQuery(acc.getArguments().get(0), new Boolean(acc.optimize), new Boolean(
+        IHyracksClientConnection hcc = exec ? new HyracksConnection("localhost", acc.hyracksPort) : null;
+        AsterixJavaClient q = compileQuery(hcc, acc.getArguments().get(0), new Boolean(acc.optimize), new Boolean(
                 acc.onlyPhysical), exec || new Boolean(acc.hyracksJob));
         if (exec) {
-            q.execute(acc.hyracksPort);
+            q.execute();
         }
     }
 
-    private static AsterixJavaClient compileQuery(String filename, boolean optimize, boolean onlyPhysical,
-            boolean createBinaryRuntime) throws Exception {
+    private static AsterixJavaClient compileQuery(IHyracksClientConnection hcc, String filename, boolean optimize,
+            boolean onlyPhysical, boolean createBinaryRuntime) throws Exception {
         FileReader reader = new FileReader(filename);
-        AsterixJavaClient q = new AsterixJavaClient(reader);
+        AsterixJavaClient q = new AsterixJavaClient(hcc, reader);
         q.compile(optimize, true, true, true, onlyPhysical, createBinaryRuntime, createBinaryRuntime);
         return q;
     }
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
index 754ccd0..ae29617 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/aql/TestsUtils.java
@@ -20,13 +20,13 @@
 import edu.uci.ics.asterix.api.aqlj.client.IAQLJConnection;
 import edu.uci.ics.asterix.api.aqlj.client.IAQLJResult;
 import edu.uci.ics.asterix.api.aqlj.common.AQLJException;
-import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
 import edu.uci.ics.asterix.api.java.AsterixJavaClient;
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.types.AbstractCollectionType;
 import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
 
 public class TestsUtils {
 
@@ -46,16 +46,16 @@
         return path.delete();
     }
 
-    public static void runScriptAndCompareWithResult(File scriptFile, PrintWriter print, File expectedFile,
-            File actualFile) throws Exception {
+    public static void runScriptAndCompareWithResult(IHyracksClientConnection hcc, File scriptFile, PrintWriter print,
+            File expectedFile, File actualFile) throws Exception {
         Reader query = new BufferedReader(new FileReader(scriptFile));
-        AsterixJavaClient asterix = new AsterixJavaClient(query, print);
+        AsterixJavaClient asterix = new AsterixJavaClient(hcc, query, print);
         try {
             asterix.compile(true, false, false, false, false, true, false);
         } catch (AsterixException e) {
             throw new Exception("Compile ERROR for " + scriptFile + ": " + e.getMessage(), e);
         }
-        asterix.execute(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT);
+        asterix.execute();
         query.close();
         BufferedReader readerExpected = new BufferedReader(new FileReader(expectedFile));
         BufferedReader readerActual = new BufferedReader(new FileReader(actualFile));
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/dml/DmlTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/dml/DmlTest.java
index 201b497..6864ec3 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/dml/DmlTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/dml/DmlTest.java
@@ -6,8 +6,6 @@
 import java.io.PrintWriter;
 import java.io.Reader;
 
-import org.junit.Test;
-
 import edu.uci.ics.asterix.api.common.AsterixHyracksIntegrationUtil;
 import edu.uci.ics.asterix.api.java.AsterixJavaClient;
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
@@ -37,13 +35,14 @@
 
         AsterixHyracksIntegrationUtil.init();
         Reader loadReader = new BufferedReader(new FileReader(LOAD_FOR_ENLIST_FILE));
-        AsterixJavaClient asterixLoad = new AsterixJavaClient(loadReader, ERR);
+        AsterixJavaClient asterixLoad = new AsterixJavaClient(
+                AsterixHyracksIntegrationUtil.getHyracksClientConnection(), loadReader, ERR);
         try {
             asterixLoad.compile(true, false, false, false, false, true, false);
         } catch (AsterixException e) {
             throw new Exception("Compile ERROR for " + LOAD_FOR_ENLIST_FILE + ": " + e.getMessage(), e);
         }
-        asterixLoad.execute(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT);
+        asterixLoad.execute();
         AsterixHyracksIntegrationUtil.destroyApp();
 
         AsterixHyracksIntegrationUtil.createApp();
@@ -51,7 +50,8 @@
         String resultFileName = TestsUtils.aqlExtToResExt(enlistFile.getName());
         File expectedFile = new File(PATH_EXPECTED + SEPARATOR + resultFileName);
         File actualFile = new File(PATH_ACTUAL + SEPARATOR + resultFileName);
-        TestsUtils.runScriptAndCompareWithResult(enlistFile, ERR, expectedFile, actualFile);
+        TestsUtils.runScriptAndCompareWithResult(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
+                enlistFile, ERR, expectedFile, actualFile);
 
         AsterixHyracksIntegrationUtil.deinit();
         for (String d : ASTERIX_DATA_DIRS) {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
index 46a068c..416734f 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTest.java
@@ -145,7 +145,8 @@
     @Test
     public void test() throws Exception {
         Reader query = new BufferedReader(new FileReader(queryFile));
-        AsterixJavaClient asterix = new AsterixJavaClient(query, ERR);
+        AsterixJavaClient asterix = new AsterixJavaClient(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
+                query, ERR);
         try {
             LOGGER.info("Query is: " + queryFile);
             asterix.compile(true, false, false, false, false, true, false);
@@ -153,7 +154,7 @@
         } catch (AsterixException e) {
             throw new Exception("Compile ERROR for " + queryFile + ": " + e.getMessage(), e);
         }
-        asterix.execute(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT);
+        asterix.execute();
         query.close();
 
         if (actualFile.exists()) {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java
index 22cb378..5fc3599 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/metadata/MetadataTransactionsTest.java
@@ -81,13 +81,14 @@
         String actualFileName = (String) queryTuple[2];
         try {
             Reader query = new BufferedReader(new FileReader(queryFileName));
-            AsterixJavaClient asterix = new AsterixJavaClient(query, ERR);
+            AsterixJavaClient asterix = new AsterixJavaClient(
+                    AsterixHyracksIntegrationUtil.getHyracksClientConnection(), query, ERR);
             LOGGER.info("Query is: " + queryFileName);
             asterix.compile(true, false, false, false, false, executeQuery, false);
             // We don't want to execute a query if we expect only DDL
             // modifications.
             if (executeQuery) {
-                asterix.execute(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT);
+                asterix.execute();
             }
             query.close();
         } catch (Exception e) {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index 6ca8aef..5d0071e 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -123,7 +123,7 @@
 
             Reader query = new BufferedReader(new FileReader(queryFile));
             PrintWriter plan = new PrintWriter(actualFile);
-            AsterixJavaClient asterix = new AsterixJavaClient(query, plan);
+            AsterixJavaClient asterix = new AsterixJavaClient(null, query, plan);
             try {
                 asterix.compile(true, false, false, false, true, true, false);
             } catch (AsterixException e) {
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java
index e101e2b..0aa755c 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/runtime/RuntimeTest.java
@@ -44,6 +44,7 @@
     private static final String[] ASTERIX_DATA_DIRS = new String[] { "nc1data", "nc2data" };
 
     private static final Logger LOGGER = Logger.getLogger(RuntimeTest.class.getName());
+
     // private static NCBootstrapImpl _bootstrap = new NCBootstrapImpl();
 
     private static ArrayList<String> readFile(String fileName) {
@@ -83,12 +84,10 @@
         lsn.deleteOnExit();
 
         AsterixHyracksIntegrationUtil.init();
-        // _bootstrap.start();
     }
 
     @AfterClass
     public static void tearDown() throws Exception {
-        // _bootstrap.stop();
         AsterixHyracksIntegrationUtil.deinit();
         File outdir = new File(PATH_ACTUAL);
         File[] files = outdir.listFiles();
@@ -151,7 +150,8 @@
             }
             Assume.assumeTrue(!TestHelper.isInPrefixList(ignore, queryFileShort));
             LOGGER.severe("RUNNING TEST: " + queryFile + " \n");
-            TestsUtils.runScriptAndCompareWithResult(queryFile, ERR, expectedFile, actualFile);
+            TestsUtils.runScriptAndCompareWithResult(AsterixHyracksIntegrationUtil.getHyracksClientConnection(),
+                    queryFile, ERR, expectedFile, actualFile);
         } catch (Exception e) {
             if (!(e instanceof AssumptionViolatedException)) {
                 LOGGER.severe("Test \"" + queryFile.getPath() + "\" FAILED!");
