/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package javatemplate1; import java.sql.Connection; import java.sql.Date; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Properties; /** * * @author Manas14 */ public class JavaTemplate1 implements Runnable{ @Override public void run() { // for (int x = 1; x <= 3; x++) { System.out.println(x + " Thread " + Thread.currentThread());} //Lammbda way for (int x = 1; x <= 3; x++) { new Thread( new Runnable() { public void run() { System.out.println("Hello -> from " + Thread.currentThread()); } }).start(); } // } // end of void run dbURL; /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here System.out.println("main block executing "); JavaTemplate1 run1 = new JavaTemplate1(); Thread t1 = new Thread(run1); t1.start(); // st.close(); con.commit();con.close(); } }