Q: Face Validation I am creating a login page that has image field. After the web camera captures my image,I want to validate it with the image stored in database. If it matches, it should move to the next screen else shows some failure message. how this can be achieved using java code?

A: I think your question comes under category of biometric system.

I want to validate it with the image stored in database

You can not store image of the face(At the time of enrollment) of user in database as it is.
Because at the time of the validation same user's image may vary from stored image and you cant do successful validation.
So first you have read some face recognition algorithm like this , or better you read some biometric related papers.you have to implement face recognition algorithm  using java.

A: I suggest you to use javacv (opencv built for java). There you will find a lot of API function for image matching and face recognition 
Here you can download opencv for java:
here an exampl to use opencv in java:
import org.opencv.core.Core; import org.opencv.core.Mat; import org.opencv.core.CvType; import org.opencv.core.Scalar;

class SimpleSample {

  static{ System.loadLibrary(Core.NATIVE_LIBRARY_NAME); }

  public static void main(String[] args) {
    System.out.println("Welcome to OpenCV " + Core.VERSION);
    Mat m = new Mat(5, 10, CvType.CV_8UC1, new Scalar(0));
    System.out.println("OpenCV Mat: " + m);
    Mat mr1 = m.row(1);
    mr1.setTo(new Scalar(1));
    Mat mc5 = m.col(5);
    mc5.setTo(new Scalar(5));
    System.out.println("OpenCV Mat data:\n" + m.dump());   }

}

Here is a tuto for recognition api.
Or you may do your application under C++, then make native function to be used under java, check this tuto
