title: Execute multiple hive queries using single execute() method of statement class using java
body: <p>I am using Java API to access HiveServer2, I have requirement of executing multiple hive queries in single call to <em>execute()</em> method of statements class. Is it possible to submit multiple queries of hive in one call to <em>execute()</em> method. I have hive properties to set as:</p>
  
  <pre><code>SET hive.exec.max.created.files=200000;
  SET hive.exec.compress.output=true;
  SET mapred.output.compression.codec=org.apache.hadoop.io.compress.SnappyCodec;
  SET hive.exec.dynamic.partition = true; 
  SET hive.exec.dynamic.partition.mode = nonstrict; 
  set hive.exec.max.dynamic.partitions=5000;
  set hive.exec.max.dynamic.partitions.pernode=5000; 
                .
                .
  Statement stmt = con.createStatement();
  stmt.execute("SET hive.exec.max.created.files=200000");
                .
                .
  </code></pre>
  
  <p>for that now I am setting these properties one at a time using <em>execute()</em> method. Is there any way so i can set all these properties by executing all above statement in one call to <em>execute()</em> method.
  <BR>Expected:</p>
  
  <pre><code>stmt.execute("SET hive.exec.max.created.files=200000;
      SET hive.exec.dynamic.partition = true; 
      SET hive.exec.dynamic.partition.mode = nonstrict; 
      set hive.exec.max.dynamic.partitions=5000;
      set hive.exec.max.dynamic.partitions.pernode=5000;");
  </code></pre>
  
  <p><br>Thanks.</p>