=========================================================================================== Main thread aoolotion =========================================================================================== package main; import java.util.ArrayList; import java.util.Map; import com.mycompany.lib.MyLib; import runnable_single_thread.GetSECFilingInfoData_Runnable; import runnable_single_thread.GetTickerWithKeyword_Runnable; import runnable_single_thread.Temp_Runnable; public class Multithread_Temp_Main { public static void main(String[] args){ String limit_scope = ""; int group_cnt = 80; for ( int i = 0; i < 100; i++ ) { limit_scope = "limit " + String.valueOf( i * group_cnt ) + ", " + String.valueOf( i * group_cnt + group_cnt ); // System.out.println(limit_scope);; Thread thread = new Thread( new Temp_Runnable( limit_scope ) ); thread.start(); // if ( i > 2 ) break; } } } ============================================================================================ child thread ============================================================================================ package runnable_single_thread; import java.io.BufferedReader; import java.io.InputStreamReader; import java.net.URL; import java.net.URLConnection; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import com.mycompany.lib.MyLib; import tools.LinearRegression; public class Temp_Runnable implements Runnable { private String limit_scope = ""; public Temp_Runnable(String limit_scope ) { this.limit_scope = limit_scope; System.out.println(this.limit_scope); } public void run() { // TODO Auto-generated method stub MyLib myLib = new MyLib(); Map def_map = myLib.getDSMap(); System.out.println("Thread starts "); try { String driver_classname = (String)def_map.get("jdbcclassnm"); String login_id = (String)def_map.get("dbserverid"); String server_url_web = (String)def_map.get("dbserverurl"); String login_pw_web = (String)def_map.get("dbserverpw"); java.lang.Class.forName( driver_classname ); java.sql.Connection con_web = java.sql.DriverManager.getConnection( server_url_web, login_id, login_pw_web ); java.sql.PreparedStatement stmt = null; java.sql.PreparedStatement stmt_1 = null; java.sql.ResultSet rs = null; java.sql.ResultSet rs_1 = null; con_web.setAutoCommit(true); String backend_sql_string = ""; backend_sql_string = "select distinct ticker" + " from class_4.ticker_hist " + this.limit_scope ; System.out.println(backend_sql_string); stmt = con_web.prepareStatement( backend_sql_string ); rs = stmt.executeQuery(); String str = ""; int count = 0; while ( rs.next() ) { count = count + 1; // if ( count > 2 ) break; String ticker = rs.getString( "ticker" ); System.out.println( "process ticker: " + ticker ); } } catch ( Exception e ) { System.out.println( e.getMessage() ); e.printStackTrace(); } } } ==================================================================================