package com.socnet;

import com.socnet.db.DBHelper;
import java.sql.Connection;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Main {
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        Runnable task = () -> {
            String threadName = Thread.currentThread().getName();
            System.out.println("Hello " + threadName);
        };

        task.run();

        Thread thread = new Thread(task);
        thread.start();

        System.out.println("Done!");
        
        try {
            DBHelper dbClient = new DBHelper();
            System.out.println("DBConnection"+ dbClient.toString());            
        } catch (Exception e) {
            System.err.println("DBError"+ e.toString());
        }

    }
}

@@ -56,90 +56,35 @@
 ort 
-java.sql.Connection;%0Aimport java.util.logging.Level;%0Aimport java.util.logging.Logg
+com.socnet.network.HttpServ
 er;%0A
@@ -166,16 +166,57 @@
      */%0A
+    @SuppressWarnings(%22empty-statement%22)%0A
     publ
@@ -264,98 +264,340 @@
     
-Runnable task = () -%3E %7B%0A            String threadName = Thread.currentThread().getName();%0A
+try %7B%0A            DBHelper dbClient = new DBHelper();%0A        %7D catch (Exception ex) %7B%0A            System.err.println(ex);%0A        %7D%0A        %0A        %0A        try %7B%0A            HttpServer.createHttpServer(8888, new HttpServer.Handler() %7B%0A                @Override%0A                public String getResponce(String request) %7B%0A        
     
@@ -628,28 +628,26 @@
 ln(%22
-Hello %22 + threadName
+Request: %22+request
 );%0A 
@@ -657,20 +657,16 @@
     
-%7D;%0A%0A
         
 task
@@ -665,88 +665,188 @@
     
-task.run();%0A%0A        Thread thread = new Thread(task);%0A        thread.start();%0A%0A
+    return %22%7B%5C%22id%5C%22:123, %5C%22message%5C%22:%5C%22%22+request+%22%5C%22%7D%22;%0A                %7D%0A                %0A                @Override%0A                public void onError(Throwable e) %7B%0A            
     
@@ -848,35 +848,35 @@
          System.
-out
+err
 .println(%22Done!%22
@@ -873,14 +873,40 @@
 ln(%22
-Done!%22
+HttpServer error: %22+e.toString()
 );%0A 
@@ -904,32 +904,41 @@
 ing());%0A        
+  
+      %7D
 %0A        try %7B%0A 
@@ -934,59 +934,135 @@
     
-try %7B%0A            DBHelper dbClient = new DBHelper(
+    %7D).start();%0A            %0A            %0A            long tick=0;%0A            while(true) %7B%0A                Thread.sleep(15000
 );%0A 
@@ -1064,32 +1064,36 @@
 0);%0A            
+    
 System.out.print
@@ -1100,56 +1100,74 @@
 ln(%22
-DBConnection%22+ dbClient.toString());            
+Main thread tick... %22+tick);%0A                tick++;%0A            %7D
 %0A   
@@ -1180,25 +1180,25 @@
  catch (
-Exception
+Throwable
  e) %7B%0A  
@@ -1230,44 +1230,38 @@
 tln(
-%22DBError%22+ e.toString());%0A        %7D%0A
+e);%0A        %7D%0A                
 %0A   

test in main class