Feeds:
Posts
Comments

Archive for November 3rd, 2008

class Singleton{
private static Singleton singletonObject;
private static int single;
/** A private Constructor prevents any other class from instantiating. */
private Singleton(){
// Optional Code
single++;
System.out.println(“Singleton Zero ARGS Constructor:”+single);
}
public static synchronized Singleton getSingletonObject()
{
if (singletonObject == null){
singletonObject = new Singleton();
}
return singletonObject;
}
public Object clone()throws CloneNotSupportedException
{
throw new CloneNotSupportedException();
}
}
public class SingletonObjectDemo {
public static void main(String args[]){
// Singleton obj = new Singleton(); Compilation error not [...]

Read Full Post »

JVM, JRE, JDK

JVM is interpreter.
JVM is an instance of JRE comes into action when a java program is executed.
JVM + API  JRE
JVM may use Just in time compiler for interpreting or uses set of JVM instructions set.
JIIT is the part of the JVM that is used to speed up the execution time. JIT compiles parts of [...]

Read Full Post »

Interpreter and compile

The name “compiler” is primarily used for programs that translate source code from a high-level programming language to a lower level language (e.g., assembly language or machine language). A compiler is likely to perform many or all of the following operations: lexical analysis, preprocessing, parsing, semantic analysis, code generation, and code optimization.

A compiler first takes [...]

Read Full Post »

Web and application server

Webserver serves pages for viewing in web browser, application server provides exposes business logic for client applications through various protocols

Webserver exclusively handles http requests.application server serves business logic to application programs through any number of protocols.

Webserver delegation model is fairly simple,when the request comes into the webserver,it simply passes the request to the program best [...]

Read Full Post »

Think of the include directive as a header file of languages like C/C++. When using the include directive, the combined contents of the original JSP page and all its included resources are translated into the same implementation servlet i.e. the contents of the included resource is copy pasted before translation to a servlet. The important [...]

Read Full Post »

 JDBC technology drivers fit into one of four categories:

A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Note that some ODBC native code and in many cases native database client code must be loaded on each client machine that uses this type of driver. Hence, this kind of driver is [...]

Read Full Post »