title: How to improve velocity of Java code invoking webservice and logging the whole process?
body: <p>I made a Java application that reads some rows from a table on Oracle and then invoke a web-service for each row taken.<br>
  This process is taken more time than expected. About 4 rows per second are being invoked, I would expect about 50 rows per seconds.<br>
  I used wsimport tool to generate the files to access to the webservice. All the process is being logged with libraries slf4j and Log4j.<br><br>
  What can I do for improve the velocity of the whole process?<br>
  Could multi threading help in this case?</p>
  
  <p>This is a brief of my code:</p>
  
  <pre><code>query = "select * from table name where to_char(DATE, 'hh24:mi:ss') &gt;= '"+tMin+"' and to_char(DATE, 'hh24:mi:ss') &lt; '"+tMax+"'";
  
  Class.forName("oracle.jdbc.driver.OracleDriver");
  con = DriverManager.getConnection("jdbc:oracle:thin:"+connection_string);
  stmt = con.createStatement();
  rs = stmt.executeQuery(query);
  
  while( rs.next() ){
  
      SomeBean n = new SomeBean();
      n.setColumn1(rs.getString("Column1"));
      n.setColumn2(rs.getString("Column2"));
      n.setColumn3(rs.getString("Column3"));
      n.setColumn4(rs.getString("Column4"));
      n.setColumn5(rs.getString("Column5"));
      v.add(n);   
  
  }
  
  for(SomeBean s : v)
  {   
  
      String Column1 = s.getColumn1);
      String Column2 = s.getColumn2();
      String Column3 = s.getColumn3();
      String Column4 = s.getColumn4();
      String Column5 = s.getColumn5();
  
  
      someInfo1.setColumn1(Integer.parseInt(Column1));
      someInfo1.setColumn2(Column2);
      someInfo1.setColumn3(Column3);
  
      someInfo2.setColumn4(Column4);
      someInfo2.setColumn5(Integer.parseInt(Column5));
  
      try 
      {                       
          Result resultws = Webservice.webservice(someInfo1, someInfo2);
      }
      catch (Exception e) 
      {
          //catch exception
      }
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/iAP8y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/iAP8y.png" alt="VisualVM - CPU sample"></a></p>