How To Become An SEO Expert

by Master Mind | 5:43 AM in | comments (2)

Yeah, this is very difficult to answer this question. Search engine Optimization is the thing you have to learn it all by yourself. I can say that there will not be any schools or colleges for SEO courses. You will get many online programs to learn SEO. But all those programs are nothing but shit. You got many websites of full of resourses on SEO. Just remember What you know about SEO is much and more important than the certificate says that you are an SEO expert. You have to spend much and more amount of time on reading article, questions in forums, websites and lastly implementation. SEO is nothing but 20% theoritical and 80% implementation.

In my sense we can become an SEO expert only when we study about Search engine algorithms. In the whole web you cannot get how search engine algorithms are written.These algorithms are completely made secret. If you have completely make a research on “How google algorithm crawls websits?” then you are said to be an SEO expert. You have to test google algorithm and learn proporly and carefully how does google algorithm works. This is time taking process. Because of this reason i said, it is very difficult to become an SEO expert.

Now!!! How to test google algorithm?
In this article i will explain few tricks to test google algorithm. If you have successfully tested those tricks then your webpage will definitely (i am not sure :D) comes in google 1st page. I have already tested these tricks. Few of my tricks are working successfully.

How to become an seo expert

1)Choose some niche keyword for example ” how to become an seo expert“. Open 1st three websites and copy their contents in word document. Checkout keyword frequency for individual content. Most webmasters says google always checks 1/4 of content from starting. Now check keyword frequency for first 1/4 of content. Now you will be knowing which content is having high frequency of keywords. Keep those keywords in a notepad.


2)You made a search for How to become an SEO expert. Right!!!!
Google always checks post title keywords. Just see the figure below. Whatever you searched in google it is highlighted. Keywords are How to become, SEO expert are highlighted. From this we can conclude almost 90% of keywords should come in Post title. Next remaining 2 lines goes to site description or first 1/4 of content. From this we can conclude that maximum keywords should present in site title description or first 1/4 of content (post) .

How to become an seo expert

3) This is very important step: Check backlinks for individual posts. You are searching backlinks for 1st 3 websites for choosen keywords “how to become an SEO expert?” . If any website who is bringing link from higher pr with RELAVENT CONTENT then he will rank 1st. Google always gives priority for good quality of backlinks. Well this is very simple process :D..Try to post in forum websites. I have seen this question ” How to become an seo expert” in many forums. Try to post your article with your website link in those forums. This is the direct way of getting your post position in google top 10.

4) Most webmasters says, google checks keywords in domain name. Well this is also tested. google is cecking number of keywords in domain name. Depending upon those keywords ranking is decided.

5) age of post??? Yes.. google checks age of post. But this is not the serious issue. We can bring new post with same title keywords just above the old post. That is we can rank better than old post with same title keywords. This can be done only when we optimize better than him, more backlinks than him etc etc.

6) Age of domain?? I dont know whether google checks age of domain or not. I have tested for many websites. But this factor is the least preferred. If keyword frequency is same for all websites and their backlinks are also same then google algorithm checks age of domain.

Any many tricks which cannot be explained here.In this article i have explained only about SEO (search engine optimization) but not SEM ( search engine marketing) . SEM comes under promoting our website, linkbuilding, Advertising etc etc

Many people are trying to optimize their website for search engines. submitting their websites to article directories to get good backlinks. They just think about backlink. They dont even think whether this link redirects to their home page or any internal page of their website. They dont know what is the importance of internal link power.
It is true major search engines such as google, yahoo, msn etc gives lot of importance for internal links. Most notably google, gives lot of importance to internal link power. When google spiders crawl any website they enter in to Anchor text link. Those spiders enters in to the website which is internally linked. If that website contains similar content then there may be chances for getting higher pagerank for that link when compared to home page. Just observe the below picture you will get whole information about Internal link power . Every link to a single
page on your website should contain targeted keywords which explain what is on that page, and to which you are trying to market.




After selecting the Niche you need to choose targeted keywords. Refer this article How to choose keywords inside the post??. Depending upon the keywords you have to give anchor text links to similar pages.

Actual Power of keyword
Keywords play a major role in Search engine Optimization. Let us take an example. You have build an website on Search engine Optimization. You will choose site title depending on your website which contains a rich keywords. Now you are having a sub page and that title is “Internal link power”. You are going to link your sub page to your home page. If you choose keyword ” link power” instead of “internal link power ” in the navigation bar,then your are losing much traffic from search engines and and will stand a better chance of appearing in SERPs for those keywords. Search engines likes deep search. Always be specific in your keywords.
Not only from home page try to bring link from related topics.For example you have done post on How to build links?? then in the middle of the post try to place anchor text link for Internal link power. These links should also contain appropriate keywords, which will further increase the effectiveness of your internal links.

Actual Link power
Dont bluff number of links in your home page. It looks very dirty. Visitors hate number of links in home page. And dont give links for large sentences. Always give link for short and brief sentences. In your home page different links are given different priority. Try to place limited links, in those links you can place sublinks. For example consider my sitemap, Except my home page and about me page all other links are given 20% priority. For home page and about me it is given 60% priority. Your home page is usually the page which is linked to the most, and therefore probably has the highest authority as i said before about my sitemap, or in Google’s terms PageRank, than any other page on your website. Every page that it links to will gain from the power of that link.



Where Should I Use My Keywords??

by Master Mind | 5:29 AM in | comments (0)

Where should i use my keywords???
After describing what your website is about, search engines pay close attention on the keywords you use in your Title, Heading, Body ,Meta tags and links. So make sure to provide rich keywords in those areas. Always try to keep rich keywords in the top of the page. Don’t use links in the top of the page. If user checks your post he reads from the top of the page. After seeing the link with keyword he clicks on the link. This is how you lost your visitors before completing whole page. In most cases webmasters keep text links at the bottom of the page.
Always use keywords in headings. Google,Yahoo and most search engine algorithms checks First 3 keywords. And these Three keywords should be placed in Title with H1 tags. Except title we should not use H1 tags anywhere in home page. Keeping your keywords in Headings will boost your visitors. For example let us consider this post. Here i used these keywords in title — Where should i use my keywords –.When you type - where should i use keywords - in Google i hope my site comes in first page. Using these keywords you have to maintain keyword frequency within the post. A site wide average keyword density should be 2%. Density is the measure of frequency in relation to the total word count of the page.If your page is having 200 words,and your keyword phrase appears 10 times, density will be 5%.
There are meta tags with in the HTML code.Meta tags plays a major role.When search engine crawls website it first looks Meta tags and description.There is some debate that how important the meta tags are when comes across SEO. Meta tags shouldn’t be ignored.

How Search Engines Works

by Master Mind | 5:27 AM in | comments (1)

How Search Engine works?
Search Engines contain large amount of data.And this data was spread out in every part of the world on remote web servers.The problem of locating correct page depends up on Search Engine algorithm. Different search engines have different algorithms.For example let us take this keyword “How search engine works“. When you type This keyword (How search engine works) in google it shows total 18,400,000 indexed pages. And in Yahoo it shows total 130,000,000 indexed pages. This website computer.howstuffworks.com takes first place in google for the given keywords ( How search engine works) . but it shifts to shifts to 3 position for the same given keywords in yahoo. From this we can understand different search engines have different algorithms. In order to understand the methods and techniques to position your website pages for higher ranking in search engines, the knowledge of the basic functioning of a search engine is must.

Search engine is a computer software.Every year search engine algorithm changes with improved technologies to provide better search results.All search engines does the same function as collecting data ,organizing, indexing and serving results in their own ways. the functions of search engine can be divided in to following:

* Crawling pages from the internet.
* Organizing and indexing the web pages.
* Storing website content.
* Search engine algorithms and results.

How search engine works?????
When we submit our website link to search engine it crawls data. search engines crawls using bots and spiders. It has to crawl millions of pages so it takes time for indexing our data. The crawler or web spider is a computer software program that can download web content , and then follow hyper-links within these web contents or pages to download the linked contents.

The crawling continues until it finds a logical stop, such as a dead end with no external links or reaching the set number of levels inside the websites link structure. If a website is not linked from other websites on the internet, the crawler will be unable to locate it. Therefore, if the website is new, and has no links from other sites, that website has to be submitted to each of the search engines for crawling.News and media sites are crawled regularly by search engines like google ,yahoo, msn why because they need to update their information in servers and display latest search results.Usually search engines crawl only a few (three or four) levels deep from the homepage of a website. The term deep crawl is used to denote that the crawler or spider can index pages that are many levels deep. Google is an example of a deep crawler.After crawling the pages they gather huge amount of data and store them in their database.This is how search engine works.

Optical Illiusions Part 1

by Master Mind | 6:58 AM in | comments (0)

Enjoy.....;)

Project Management: Authentication - Create the Table


(Page 2 of 4 )

So create a table with the following SQL:

CREATE TABLE `users` (

`uid` int(11) NOT NULL auto_increment,

`name` varchar(20) NOT NULL default '',

`sname` varchar(20) NOT NULL default '',

`uname` varchar(100) NOT NULL default '',

`upass` varchar(8) NOT NULL default '',

`level` enum('admin','normal') NOT NULL default 'normal',

`last_login` datetime NOT NULL default '0000-00-00 00:00:00',

`email` varchar(100) NOT NULL default '',

PRIMARY KEY (`uid`)

) TYPE=MyISAM AUTO_INCREMENT=5 ;



Below is some sample data for the table:


INSERT INTO `users` VALUES (1, 'jack', 'dee', 'jack.dee', 'pass', 'admin', '0000-00-00 00:00:00', 'jack@dee.com');

INSERT INTO `users` VALUES (2, 'maria', 'garises', 'maria.garises', 'pass', 'normal', '0000-00-00 00:00:00', 'maria@garises.com');

INSERT INTO `users` VALUES (3, 'kine', 'brand', 'kine.brand', 'pass', 'normal', '0000-00-00 00:00:00', 'kine@brand.com');

INSERT INTO `users` VALUES (4, 'john', 'doe', 'john.doe', 'pass', 'normal', '0000-00-00 00:00:00', 'john@doe.com');


Copy and paste the above SQL in your MySQL administration application and run it. You should have a table called "users" with the sample data above. Now, let's create the login script that will run the login process for us. Create a new PHP document and add the following code:


include "dbcon.php";

include "functions.php";

//initialise variables

$err=false;

$errmsg="";


//is form submitted?

if(isset($_POST['submit'])){

//check that the form values are not empty, if so, set errormsg value

if(empty($_POST['uname'])){

$errmsg="The username field is empty, please enter a username
";

$err=true;

}

if(empty($_POST['upass'])){

$err=true;

$errmsg .="The password field is empty, please enter password
";

}


//check that the username is in correct format

if(!checkformat($_POST['uname'])){

$err=true;

$errmsg .="The username that you entered has a incorrect format.
";

}



//if there is no errors above, then clean the form values before using in query.

if(!$err){

$cleanuname = mysql_escape_string($_POST['uname']);

$cleanupass = mysql_escape_string($_POST['upass']);


$checkuser = "SELECT * from users WHERE uname = '".$cleanuname."' AND upass = '".$cleanupass."'";

$checkuser_res = mysql_query($checkuser);

$checkuser_num = mysql_num_rows($checkuser_res);


if($checkuser_num > 0){

//if user exists and passes authentication

//setup session variables and redirect to index page

$row = mysql_fetch_assoc($checkuser_res);

$_SESSION['name'] = $row['name']." ".$row['sname'];

$_SESSION['uid'] = $row['uid'];

$_SESSION['level'] = $row['level'];


//redirect

header("location:main.php");

}else{

//if values do not match set errmsg

$err=true;

$errmsg .="The username or password you entered does not match.
MYSQL ERROR ".mysql_error();

}//else


}//end $err check


} //end form submit check


?>

Project Management ::Login


Project Management:: User Authentication

}

?>

Login
Username:
Password:
Forgot your password?

copyright © 2007 PM








Project Management: Authentication 1

by Master Mind | 1:03 AM in | comments (0)

Project Management: Authentication


(Page 1 of 4 )

I recently completed an article series in which we built a project management application. Every application that wants to control access to its resources has an access control mechanism that will verify if a user is allowed to use the particular application. A project management application is a good candidate for such a control. In this four-part series, we will build an authentication system for the application.

There may be any number of reasons an application needs to control access. For example, the application may need to grant certain privileges to some and different ones to others. It can also be that the application simply wants to keep track of the user.

In our application, we want to keep track of the user in addition to making sure that a user is actually allowed to use the application. And we also grant different levels of security or access for different users, to sections of the application. The application has an administration section that will make use of this access control, as you will see later on.

How it works




As the diagram shows, the user is presented with an HTML login form that has the username and password fields. Once the user enters the required username and password, PHP tries to match the password and username that the user entered to the username and password in the database.

If it finds a match, the user is granted access to the Project Management application; if it does not find a match, the user is redirected to the HTML login form with a error message saying that the username or password did not match. Before we go on to look at the code that enables this to happen, let's look at the users table. It holds the user login credentials.

The Database Table

Let's look at the requirements for a table that will hold the user log-in information. Any user that wants to use our application needs to have a username and password. These are the key log-in details that are required. I've decided that the username must have the following format:


name.surname


This is because I want to make it that little bit harder for a hacker to get access to the application. We need the name and surname of the user. This is because the application assumes that it will be used in an intranet environment, where different members of the company will access it, to check on the progress of projects in which they are interested. The application will be able to address the user by his or her name, when it needs to, instead of a username that is not really appropriate.

A user will also need application level access that will enable them to create projects and users. To create a project is natural in an application that is designed for it, but to create users will require a higher level of access, simply because creating a user involves the two key aspects of user authentication: the username and more importantly the password. And if we just allow any user to create new users, then the system will not be secure. So it is essential that only certain people have the right to do so.

This is why I created two levels of access, "admin" and "normal." The "admin" access level has no restrictions, while, as you'd expect, the "normal" access level does. If a user forgets his or her password, we need some way of getting the password to him or her. In that case, we need to have an email address for the user. So based on the above considerations, our "users" table should have the following fields:


username - The username with format name.surname

password - a seven character password is automatically generated

name - name of user

surname - surname of user

level - access level is either admin or normal

email - user email address, in case the pass word is forgotten

last_login - date of last log-in

MOTO RACER 2 FREE DOWNLOAD

by Master Mind | 7:57 AM in | comments (0)

MOTO RACER 2

FOR BIKES LOVERS

ENJOY...;)


DOWNLOAD LINK



TOMB RAIDER LARA CRAFT FREE DOWNLOAD

by Master Mind | 7:41 AM in | comments (0)

TOMBRAIDER LARA CRAFT ANNIVERSERY

eNJOY

PC Requirements

Minimum Specification:

OPERATING SYSTEM: Microsoft Windows 2000, XP, Vista
CPU: Pentium 3 1.4Ghz or Athlon XP 1500+
RAM: 256MB (for Windows 2000/XP), 512MB (for Windows Vista)
GRAPHICS: 100% DirectX 9.0c compatible 64 MB 3D Accelerated Card with TnL (GeForce 3Ti / Radeon 9 series)
SOUND: Microsoft Windows 2000/XP/Vista compatible sound card (100% DirectX 9.0c -compatible)
DVD-ROM: Quad-speed (4x) DVD-ROM drive
HARD DRIVE: 4GB free disk space
INPUT DEVICES: 100% Windows 2000/XP/Vista compatible mouse and keyboard

Recommended Specification:

OPERATING SYSTEM: Microsoft Windows XP, Vista
CPU: Pentium 4 3.0Ghz or Athlon 64 3000+
RAM: 1GB RAM
GRAPHICS: 100% DirectX 9.0c compatible 64 MB 3D Accelerated Card with Vertex Shader 2.0 and Pixel Shader 2.0 (GeForce 6000 series / Radeon X series)
SOUND: Microsoft Windows XP/Vista compatible sound card (100% DirectX 9.0c -compatible)
DVD-ROM: Quad-speed (4x) DVD-ROM drive
HARD DRIVE: 4GB free disk space
INPUT DEVICES: 100% Windows XP/Vista compatible mouse and keyboard


dOWNLOAD







CUE CLUB FREE DOWNLOAD

by Master Mind | 7:36 AM in | comments (0)

Download CUE CLUB Game For Free

Enjoy...;)

DOWNLOAD PART1
DOWNLOAD PART2


WWE_Raw Game Download

by Master Mind | 7:32 AM in | comments (0)

For Wrestling Lovers
WWE RAW Game Free Download And Enjoy


System Requirements:
Windows 98/ME/XP compatible PC with DirectX 8
Pentium III/500MHz Processor
3D Graphics Card
128 MB RAM
705 MB of free Hard Drive Space
DirectX certified sound card
100% Microsoft compatible mouse and keyboard

DOWNLOAD PART1
DOWNLOAD PART2
DOWNLOAD PART3
DOWNLOAD PART4
DOWNLOAD PART5



by Master Mind | 4:57 AM in | comments (0)


Numbers For July They Will Appear On Daily Basis


Nod32 Antivirus Free Download

by Master Mind | 4:32 AM in | comments (0)



Links Are Here



http://rapidshare.com/files/12340079...nu_3.0.667.rar
http://download1.eset.com/download/w...v_nt32_enu.msi

Registration And Activation
http://www.4shared.com/file/55767349...v3x_Patch.html

JDBC tutorial

by Master Mind | 1:57 AM in | comments (0)

Introduction to JDBC

Java started as an elegant and promising Web programming language. Thereafter, its transition to hard-core computing environment is a phenomenal feat. Apart from its significance on client-side programming, Java has been outstanding in developing mission-critical enterprise-scale applications and hence its immense contribution to server-side computing gets all round attention. Thus Java as a programming language for enterprise computing has been doing well for the past couple of years. As every enterprise includes a database, Sun Microsystems has to come with necessary features for making Java to shine in database programming as well. In this overview, we discuss about the role of Java Database Connectivity in accomplishing database programming with ease.
Database Programming with Java

Java provides database programmers some distinct advantages, such as easy object to relational mapping, database independence and distributed computing. For languages, such as C++ and Smalltalk, there is a need for tools for mapping their objects to relational entities. Java provides an alternative to these tools that frees us from the proprietary interfaces associated with database programming. With the "write once, compile once, run anywhere" power that JDBC offers us, Java's database connectivity allows us to concentrate on the translation of relational data into objects instead of how we can get that data from the database.

A Java database application does not care what its database engine is. No matter how many times the database engine changes, the application itself need never change. In addition, a company can build a class library that maps its business objects to database entities in such a way that applications do not even know whether or not their objects are being stored in a database.

Java affects the way we distribute and maintain application. Currently a Web application allows user to download a bunch of flight information as an HTML page. While viewing the page for a particular flight, suppose some one makes a reservation for a seat on that flight and this process will not be available to the viewers as the page is just a copy of data from the database. To view the change that just occurred, the viewers again have to contact the database to get the latest data. If we reconstruct the same Web application using Java RMI to retrieve the data from a single flight object on the server, any number of users can view the data simultaneously and if there is any reservation or any change taking place, immediately the changes made to the data will be sent back to all the users and hence the users can avail the latest data at any time. Thus JDBC can combine with Java RMI to develop distributed enterprise-scale mission-critical three-tier database applications.
JDBC for Relational Databases

There are three main database technologies. They are relational, object and object-relational. A Java application can access any one of these database architectures. The overwhelming majority of today's database applications use relational databases. The JDBC API is thus heavily biased toward relational databases and their standard query language, SQL. Relational databases find and provide relationships between data and Java, as a object solution makes common cause with relational database technology due to the fact that object-oriented philosophy dictates that an object's behavior is inseparable from its data. In choosing the object-oriented reality of Java, we need to create a translation layer that maps the relational world into our object world. Thus with the goal of accessing relational databases, JDBC API specification has been defined by Sun Microsystems with the help of popular database vendors.
What is JDBC?

JDBC is essentially an Application Programming Interface (API) for executing SQL statements, and extracting the results. Using this API, we can write database clients, such as Java applets, servlets and Enterprise JavaBeans, that connect to a relational database, such as Oracle, MySQL, Sybase, Informix, Ingres, PostgreSQL, or any other database that implements this API, execute SQL statements, and process the results extracted from the database.
JDBC Versions

JDBC 2.0 API is the latest version of JDBC API available in the java.sql package. The previous version focused primarily on basic database programming services such as creating connections, executing statements and prepared statements, running batch queries, etc. However, the current API supports batch updates, scrollable resultsets, transaction isolation, and the new SQL:1999 data types such as BLOB and CLOB in addition to the SQL2 data types.

JDBC 2.0 Optional Package API is available in the javax.sql package and is distributed with the enterprise edition of Java 2, that is J2EE. The optional package addresses Java Naming and Directory Interface (JNDI)-based data sources for managing connections, connection pooling, distributed transactions, and rowsets.
The Benefits of JDBC

The JDBC API provides a set of implementation-independent generic database access methods for the above mentioned SQL-compliant databases. JDBC abstracts much of the vendor-specific details and generalizes the most common database access functions. Thus resulted a set of classes and interfaces of the java.sql package that can be used with any database providing JDBC connectivity through a vendor-specific JDBC driver in a consistent way. Thus if our application conforms to the most commonly available database features, we should be able to reuse an application with another database simply by switching to a new JDBC driver. In other words, JDBC enables us to write applications that access relational databases without any thought as to which particular database we are using.

Also database connectivity is not just connecting to databases and executing statements. In an enterprise-level application environment, there are some important requirements to be met, such as optimizing network resources by employing connection pooling, and implementing distributed transactions. JDBC has all these features in accomplishing advanced database programming.
The JDBC Drivers

A database vendor typically provides a set of APIs for accessing the data managed by the database server. Popular database vendors have supplied some proprietary APIs for client access. Client applications written in native languages such as C and C++ can make these API calls for database access directly. The JDBC API provides a Java-language alternative to these vendor-specific APIs. Though this takes away the need to access vendor-specific native APIs for database access, the implementation of the JDBC layer still need to make these native calls for data access.

JDBC accomplishes its goals through a set of Java interfaces, each gets implemented differently by different vendors. The set of classes that implement the JDBC interfaces for a particular database engine is called a JDBC driver. Hence the necessity of a JDBC driver for each database server. In building a database application, we do not have to think about the implementation of these underlying classes at all as the whole point of using JDBC is to hide the specifics of each database and let us concentrate on our application. A JDBC driver is a middleware layer that translates the JDBC calls to the vendor-specific APIs. The Java VM uses the JDBC driver to translate the generalized JDBC calls into vendor-specific database calls that the database understands.

There are a number of approaches for connecting from our application to a database server via a database driver.

JDBC-ODBC Bridge - Open Database Connectivity (ODBC) was developed to create a single standard for database access in the Windows environment. ODBC is a Windows API standard for SQL and it is based on X/Open Call-Level Interface (CLI) specification, which is a standard API for database access. CLI is intended to be vendor, platform, and database neutral. But ODBC API defines a set of functions for directly accessing the data without the need for embedding SQL statements in client applications coded in higher level languages.

The JDBC API is originally based on the ODBC API. Thus, it becomes feasible for the first category of JDBC drivers providing a bridge between the JDBC API and the ODBC API. This bridge translates the standard JDBC calls to corresponding ODBC calls. The driver then delegates these calls to the data source. Here, the Java classes for the JDBC API and the JDBC-ODBC bridge are invoked within the client application process. Similarly, the ODBC layer executes in another process. This configuration requires the client application to have the JDBC-ODBC bridge API, the ODBC driver, and the native language level API, such as the OCI library for Oracle installed on each client machine.

Each data access call has to go through many layers, this approach for data access is inefficient for high-performance database access requirements. Though this is not a preferred one, this has to be used in some situations for example, a Microsoft Access 2000 database can be only be accessed using the JDBC-ODBC bridge.

Part Java, Part Native Driver - This approach use a mixture of Java implementation and vendor-specific native APIs for data access. This one is a little bit faster than the earlier one. When a database call is made using JDBC, the driver translates the request into vendor-specific API calls. The database will process the request and send the results back through the API, which will forward them back to the JDBC driver. The JDBC driver will format the results to confirm to the JDBC standard and return them to the program. In this approach, the native JDBC driver, which is part Java and part native code, should be installed on each client along with the vendor-specific native language API. The native code uses vendor-specific protocols for communicating with the database. The improved efficiency makes this a preferred method over the use of the earlier one.

Intermediate Database Access Server This approach is based on intermediate (middleware) database servers with the ability to connect multiple Java clients to multiple database servers. In this configuration, clients connect to various database servers via an intermediate server that acts as a gateway for multiple database servers. While the specific protocol used between clients and the intermediate server depends on the middleware server vendor, the intermediate server can use different native protocols to connect to different databases. The Java client application sends a JDBC call through a JDBC driver to the intermediate data access server. The middle-tier then handles the request using another driver, for example the above one, to complete the request. This is good because the intermediate server can abstract details of connections to database servers.

Pure Java Drivers - This a pure Java alternative to part Java, part native driver. These drivers convert the JDBC API calls to direct network calls using vendor-specific networking by making direct socket connections with the database like Oracle Thin JDBC Driver. This is the most efficient method of accessing databases both in performance and development time. It also the simplest to deploy since there are no additional libraries or middleware to install. All major database vendors, such as Oracle, Sybase, and Microsoft, provide this type of drivers for their databases.
Alternatives to JDBC

There are two major alternatives to JDBC at present. They are ODBC and SQLJ, a non-approved Java standard for database access.

Without JDBC, only disparate, proprietary database access solutions exist. These solutions force the developer to build a layer of abstraction on top of them in order to create database-independent code. The ODBC solution provide this universal abstraction layer for languages, such as C and C++, and popular developmental tools, such as Delphi, PowerBuilder, and VisualBasic. But ODBC can not enjoy the platform independence of Java as ODBC is restricted to Windows platform. On using JDBC, the server application can pick the database at run time based on which client is connecting. Thus JDBC facilitates to change the database just by changing the JDBC URL and driver name without adding any new code.

Many of the major database vendors have designed SQLJ through joint work. SQLJ is a specification for writing embedded SQL in Java applications that a preprocessor can read and turn into JDBC calls.

Over View To HTTP Protocol

by Master Mind | 1:55 AM in | comments (1)

This tutorial gives the basic overview of HTTP protocol, if you are a web developer and already know the basics of the protocol, you can safely skip this tutorial. But if you are new to server side programming, you should read this tutorial carefully, as you will need to have basic understanding of HTTP protocol when you start learning Servlets and Java server pages.
The HTTP Protocol

Do you surf over the internet? If your answer is yes than you are already using HTTP protocol unknowingly. When you access any website using your favorite web browser, you are using HTTP protocol. Web browser uses the HTTP protocol to communicate with the web server.

HTTP stands for Hyper Text Transfer Protocol which is an application level protocol for transferring textual data between client and server. However HTTP can be used for many other tasks beyond its use for hypertext. HTTP is stateless protocol, that mean, client such as web browser sends the request to server, server responds and sends the requested data (such as a HTML document) or returns error code and closes the connection. Once the response is returned, server doesn’t remember anything about the client.
Http request methods and Headers

Whenever the client or browser sends the request to server for any resource such as a HTML document, it specifies the HTTP method, request URI, protocol version and optional Header information. After the client sends the request, server processes the request and sends the response. Response contains information such as status information, response headers and response data.

Following is an example of HTTP request which uses GET request method to ask for a HTML document named tutorial.html using HTTP protocol version 1.1

GET /tutorial.html HTTP/1.1

Following is the example of request header, which provides additional information about the request.

User-Agent: Mozilla/4.0 (compatible; MSIE 4.0; Windows 95) Accept: image/gif, image/jpeg, text/*, */*

Above header specifies the information about the client software and what MIME type the client accepts in response, using User-Agent and Accept headers.
Http request methods

The request method indicates the server what action to perform on the resource identified by the request-URI. HTTP/1.0 specifies three request methods: GET, POST and HEAD. HTTP/1.1 specifies five additional request methods: OPTIONS, PUT, TRACE, DELETE, and CONNECT. Servlets can process any of the above requests, however GET and POST methods meets most of the common requirements, so most of the time you will develop the Servlets which process theses two methods.
The GET request method

The GET request method is very simple and most frequently used method. The GET request is used for getting static information from the server such as HTML document, images, and CSS files. Although GET request is designed to retrieve static information, it can be used to retrieve dynamic information also by appending query string at the end of request URI.
Query String

Query string is used to pass additional request parameters along with the request. Query string consist of name value pairs and appended at the end of request URL with character ? Query string format

?name1=value1&name2=value&name3=value3 ….

Here the name is the name of the parameter and value is the value of the parameter that needs to be sent to the server for processing. name value pairs (or query parameters) are separated by ampersand sign (&). Following example show an HTTP URL which sends the request parameter userid in query string.

http://www.jsptube.com/login.jsp?userid=sudhir

The POST request method

The POST request method is commonly used to access dynamic resources. POST request is used to send the large amount of data to the server. POST request can be used to upload files to servers or even to send serializable Java objects or raw bytes. Unlike GET, POST request sends all the data as part of the HTTP request body, so it doesn’t appear in browser address bar and cannot be bookmarked. The data sent to the server is invisible to user. POST request is generally used to send HTML form parameters to server and to upload files.
Difference between GET and POST request methods

There are some differences between GET and POST requests. GET request sends the request parameters as query string appended at the end of the request URL, whereas POST request sends the request parameters as part of the HTTP request body. Since GET request sends the parameters as query string, parameters are displayed in browser address bar. User can bookmark the URL. Depending on how sensitive request parameters are, it may be a security issue. One another issue with GET request is, some servers limits the length of the URL to 240 characters, so if the too many parameters are appended in query string and URL exceeds this length, some web servers might not accept the request. These restrictions don’t apply to POST method as it sends the parameters as request body. POST requests cannot be bookmarked.
NOTE: HTTP/1.1 does not impose any restrictions on the length of URL.

Introduction To Web Containers

by Master Mind | 1:54 AM in | comments (1)

Overview of web containers:

Note: Servlets and JSP pages are collectively called web components.



This tutorial provides the basic introduction to J2EE web containers (Also called Servlet container or Servlet engine).

In J2EE architecture the basic purpose of the container is to provide the runtime environment for the components. components are managed by container, in order to be managed by container components must follow certain contract. J2EE specification defines contract between components and container, and specifies the deployment model for components. Contract specifies how components should be developed and deployed, and how components can access services provided by container. When developing applications with J2EE, we develop components that follow the contract defined in the specification.

In J2EE this contract is specified in term of various interfaces and classes, developer writes the classes that implements this interfaces or extends the classes and provides appropriate implementation of various methods and rest will be done by container. Container takes the responsibility of instantiating, initializing and invoking the components. Application does not directly instantiate or invokes components. As you will see that application never instantiate an object of servlet or call any of the init(), service() or destroy() life cycle method, all of these is handled by web container. Web container automatically instantiates and initializes the Servlets on application startup or when invoked for the first time. Container calls the service() method when user requests the servlet.

The web container is a Java runtime environment which is responsible for managing life cycle of JSP pages and Servlets. A web container is responsible for instantiating, initializing and invoking Servlets and JSP pages. The web container implements Servlet and JSP API and provide infrastructure for deploying and managing web components. The web container is part of web server or application server that provides the network services over which request and response are sent. A Web container is may be built into the web server or it may be installed as an additional component to a web server. As per the specification, all web containers must support HTTP protocol however it may support addition protocols like HTTPS.

Web container is also called servlet container or servlet engine. We will use Tomcat throughout all the tutorials. Tomcat is an open source web server, which is the web container reference implementation. You can find more information about tomcat at http://tomcat.apache.org/. If you have not already downloaded and installed Tomcat, read this tutorial Setting up a Servlet development environment which explains how to install tomcat and setup the environment. We will need to setup the development environment to run the various examples and code sameples given throughout the tutorials.

Understanding The Java Structure

by Master Mind | 1:53 AM in | comments (0)

Web Applications use a standard directory structure defined in the Servlet specification. When developing web applications on J2EE platform, you must follow this structure so that application can be deployed in any J2EE compliant web server.

A web application has the following directory structure @TODO INSERT IMAGE OF DIRECTORY STRUCTURE

The root directory of the application is called the document root. Root directory is mapped to the context path. Root directory contains a directory named WEB-INF. Anything under the root directory excepting the WEB-INF directory is publically available, and can be accessed by URL from browser. WEB-INF directory is a private area of the web application, any files under WEB-INF directory cannot be accessed directly from browser by specifying the URL like http://somesite/WEB-INF/someresource.html. Web container will not serve the content of this directory. However the content of the WEB-INF directory is accessible by the classes within the application. So if there are any resources like JSPs or HTML document that you don’t wish to be accessible directly from web browser, you should place it under WEB-INF directory.
WEB-INF directory contains

* WEB-INF/web.xml deployment descriptor
* WEB-INF/classes directory
* WEB-INF/lib directory

The classes directory is used to store compiled servlet and other classes of the application. lib directory is used to store the jar files. If application has any bundled jar files, or if application uses any third party libraries such as log4j which is packaged in jar file, than these jar files should be placed in lib directory. All unpacked classes and resources in the /WEB-INF/classes directory, plus classes and resources in JAR files under the /WEB-INF/lib directory, are made visible to the containing web application.
Note: directory and file names are case sensitive.

Introduction to Java Servlets

by Master Mind | 1:53 AM in | comments (0)

Introduction to Java Servlets

Now you have the basic understanding of the HTTP protocol, web containers, and J2EE web application structure. Before you start learning Servlet API, this tutorial provides the basic understanding of the Java Servlets.
What is a servlet?

Servlets are Java classes that process the request dynamically and generate response independent of the protocol. Servlets are defined in Java Servlet API specification. At the time of writing this tutorial, the latest Servlet API specification is 2.5 available here .

Servlets are server side Java programs which extends the functionality of web server. Servlet are protocol independent that means it can be used virtually with any protocol to process the request and generate the response. However in practice Servlets are used to process the HTTP requests and generate the HTML response.

I don’t know if the implementation is available for any other protocol like FTP or SMTP! Let me know if you know about the Servlet implementation for any other protocol.

If you are not in web development already and not aware of server side programming languages, a question which may arise in your mind is: if the Servlets generates the HTML than why do we need the Servlets? We can simply create the HTML pages instead and deploy them in any web server. The answer is in the term dynamic request handling. If you create the HTML pages which are directly served by web server, it is not a dynamic web application. A HTML document is not dynamic. It is a simple static content which is served as it is whenever a request is received. Servlets are used to generate the response dynamically based on the user request. The dynamic response generation is achieved by embedding the application logic in HTTP request-response process.

The initial goal of the HTTP protocol was to enable the sharing of information over the internet. HTTP defines what makes a valid request and valid response, how clients can request information and how server can send response, but it does not define how the response could be generated. That means HTTP protocol does not define any way to incorporate the application logic in response generation. Here the server-side technologies like PHP, ASP, Java Servlets and Java server pages come into picture. These technologies provide the way to write the application logic which sits in between the request handling and response generation phases and generate the response dynamically based on the information present in the request.

Let’s see how it is achieved with Servlets:

Whenever the web container receives a HTTP request for a resource, based on the URL of the incoming request, web container determines if the request should be handled by a servlet. If the request is to be handled by a servlet, the container checks to see if the instance of the servlet is already available. If an instance is available, the container delegates the request to that instance. If no instance of the servlet is available, container creates a new instance of the class of servlet and delegates the request to that newly created instance.

When delegating the request to a servlet for processing, web container creates the objects of class HttpServletRequest and HttpServletResponse which represents the HTTP request and HTTP response and passes these objects to the Servlet instance. The instance of HttpServletRequest provides servlet the access to incoming HTTP request information, like HTTP headers, form parameters, query string etc. The instance of HttpServletResponse provides the way to send the response to the client. It provides the methods to write the HTML to the output stream to the client, add response headers, add cookies etc.

During the request processing, the code within the servlet reads the request information, executes the application logic, and generates the response. Once the processing has been completed the response is returned to the client by writing it to the HttpServletResponse.

This tutorial provides step by step instructions to setup the development environment required to test various servlet examples given throughout all the tutorials. This tutorial will also be helpful when you start practicing servlets yourself.

List of required softwares:
# JAVA 1.5 or 1.6
# Tomcat 5.5.16
# eclipse 3.3

Note: this tutorial explains how to install required software on your windows based PC only.



First of all you need the Java software development kit 1.5 or 1.6 (JAVA SDK) installed.
Checking if JAVA is already installed in your system

Follow this step to check if Java software development kit (JDK) is already installed in your system.

To determine if JAVA SDK is already installed in your system, run the following command from command prompt.

Java –version

If JAVA platform is already installed, it will display the version of the JAVA SDK. Below screen shows JAVA version 1.6 running on a windows system. If command executes successfully and shows JAVA version 1.6, you can skip the next step.otherwise download and install the Java SDK as explained in next step.




Installing JAVA

First thing you need to install is Java software development kit (Java SDK) .Download the Java development kit 6 (JDK 6) from Sun Java SE Download site. Current latest version is JDK 6 update 6.
Setting up the JAVA_HOME

Once the JAVA SDK is installed follow this step to set the JAVA_HOME environment variable. If JAVA_HOME variable is already set, you can skip this step.

Right click on My Computer icon on your desktop it will open a popup menu, click on properties, it will open the system properties window, then click on advanced tab.

Installing JAVA

First thing you need to install is Java software development kit (Java SDK) .Download the Java development kit 6 (JDK 6) from Sun Java SE Download site. Current latest version is JDK 6 update 6.
Setting up the JAVA_HOME

Once the JAVA SDK is installed follow this step to set the JAVA_HOME environment variable. If JAVA_HOME variable is already set, you can skip this step.

Right click on My Computer icon on your desktop it will open a popup menu, click on properties, it will open the system properties window, then click on advanced tab.



Click on environment variables button, it will open the environment variables window as shown in figure below. Initially there will be no JAVA_HOME environment variable set as shown in figure.



Click on new button to add new system variable JAVA_HOME.




Installing Tomcat

Tomcat is an opensource web container. it is also web container reference implementation. You will need tomcat 5.5.16 installed on your system to test various servlet and JSP examples given in other tutorials.

Download the latest version of tomcat from this URL . Download the jakarta-tomcat-5.0.28.tar.gz and extract it to the directory of your choice.

Note: This directory will be referred to as in other tutorials.

That’s all, tomcat is installed. It’s very easy, isn’t it?
Starting and shutting down Tomcat

To start the tomcat server, open the command prompt, change the directory to TOMCAT HOME/bin and run the startup.bat file. It will start the server.

>startup



To shut down the tomcat server, run the shutdown.bat file. It will stop the server.

>shutdown


Verifying Tomcat installation

To verify that tomcat is installed properly, start the server as explained above, open the web browser and access the following URL.

http://localhost:8080/index.jsp

It should show the tomcat welcome page, if tomcat is installed properly and server is running.


Setting up the CLASSPATH

Now you need to create a new environment variable CLASSPATH if it is not already set. We need to add the servlet-api.jar into the CLASSPATH to compile the Servlets. Follow the same steps as you did to create the JAVA_HOME variable. Create a new variable CLASSPATH under system variables. Add /lib/servlet-api.jar in variable value field.