public Trace getTrace_v3(int xStart, int yStart, int sourceID, int threshold)
    {
        // Multiple query to be created based on threshold:
        String multiQuery = "";
        
        for (int i=0; i < threshold; i++)
        {
            for (int j=0; j < threshold; j++)
            {
                multiQuery += MACRO_QUERY;
            }//for
        }//for

        // the returned queried value from database:
        byte [] samples = null;

        // the returned Trace object:
        Trace trace = null;

        // ResultSet objects:
        ResultSet resultSet;

        try
        {
            // Creating a PreparedStatement object
            PreparedStatement pStatement = con.prepareStatement(multiQuery);

            //System.out.println("PreparedStatement object created. \n");

            try
            {
                // set parameters of the statement:
                int counter = 1;
                for (int i=0; i < threshold; i++)
                {
                    for (int j=0; j < threshold; j++)
                    {
                        pStatement.setInt(counter++, (xStart+i));
                        pStatement.setInt(counter++, (yStart+j));
                        pStatement.setInt(counter++, sourceID);
                    }//for
                }//for                
                
                // [TEST] measure execution time:
                long startTime = System.currentTimeMillis();

                // run the multiple query in one go:
                pStatement.execute();

                // [TEST] get end time and print:
                long endTime = System.currentTimeMillis(); 
                //FESVoSystem.out.println("Executed multi-statement query in: " + (endTime - startTime) + " ms.");
                FESVoSystem.out.print((endTime - startTime) + " ");
                
                
                
                // get result sets:
                loop: for (int i=0; i < threshold; i++)
                {
                    for (int j=0; j < threshold; j++)
                    {
                        // [TEST] measure execution time:
                        //startTime = System.currentTimeMillis();

                        // get result set
                        resultSet = pStatement.getResultSet();

                        // [TEST] get end time and print:
                        //endTime = System.currentTimeMillis(); System.out.println("Time: " + (endTime - startTime) + " ms.");

                        // get the value of the property value column:
                        // if no row is available, return null
                        if (resultSet.next()){
                            samples = resultSet.getBytes(1);
                            trace = new Trace(xStart+i, yStart+j, sourceID);
                            trace.setSamples(samples);
                            break loop;
                        }//if

                        // move to next result set:
                        pStatement.getMoreResults();

                    }//for (j)
                }//for (i)


            }//try

            finally
            {
                // Close the statement
                pStatement.close();
                //System.out.println("Statement object closed. \n");
            }//finally


        }//try

        catch(SQLException ex)
        {
            // A SQLException was generated.  Catch it and display
            // the error information.
            // Note that there could be multiple error objects chained
            // together.
            System.out.println();
            System.out.println("*** SQLException caught ***");

            while (ex != null)
            {
                System.out.println(" Error code: " + ex.getErrorCode());
                System.out.println(" SQL State: " + ex.getSQLState());
                System.out.println(" Message: " + ex.getMessage());
                ////ex.printStackTrace();
                System.out.println();
                ex = ex.getNextException();
            }

            throw new IllegalStateException ("Sample failed.") ;

        }//catch

        // return the retrieved samples as a byte array
        return trace;
    }//getTrace