title: Kill Sybase processes using batch with java jdbc
body: <p>I used Java to create a simple database process killer by sending a kill command in a loop. I want to know if I can use batch with kill command in one call:</p>
  <pre><code>try(Connection dbCon = GetDBConnection()){
      try (Statement st = dbCon.createStatement();) { 
          dbCon.setAutoCommit(false);
          for (int i = 0; i &lt; processes.length; i++) {
              st.addBatch(&quot;kill &quot; + processes[i]);
          }
          st.executeBatch(); 
          dbCon.commit();
          dbCon.setAutoCommit(true);
      } 
      catch (Exception e) {
          System.out.println(&quot;Error SQL killing process: &quot; + e);
      }
  catch (Exception e) {
      System.out.println(&quot;Error opening connection: &quot; + e);
  }
  </code></pre>