Monday, 17 December 2012

Threads in java


class Thrchild implements Runnable
{
Thread t;
Thrchild()
{
t=new Thread(this,"Demo Thread");
System.out.println("Child Name"+t);
t.start();
}
public void run()
{
try
{
for(int i=1;i<=5;i++)
{
System.out.println("-->Child thread running"+i);
t.sleep(400);
}
}
catch(Exception e)
{
System.out.println("Exception in child"+e);
}
System.out.println("Child thread Completed");
}
}
public class Thrswitch {
public static void main(String arg[])
{
Thrchild tc=new Thrchild();
try
{
for(int i=1;i<=5;i++)
{
System.out.println("Main thread running"+i);
Thread.sleep(1000);
}
}
catch(Exception e)
{
System.out.println("Exception in main"+e);
}
System.out.println("Main thread Completed");
}
}

DBT - Models

Models are where your developers spend most of their time within a dbt environment. Models are primarily written as a select statement and ...