Code example for CallableStatement

Methods: execute

0
      List<Thread> threadList = new ArrayList<Thread>();
 
      for (int l = 0; l < 3; l++)
      { 
        final int i = l;
 
        Thread thread = new Thread()
        { 
          @Override 
          public void run() 
          { 
            try 
            { 
              if (i == 0)
              { 
                Thread.sleep(1000);
                s.cancel();
              } 
              else if (i == 1)
              { 
                //or use some other statement which will block for a longer time