I'm new programmer.

I'm a new user of java programming language, I have a small problem in server and client code.
I'm creating a program that allowed user to enter their username and password, after that the program will compare the user name and the password from the data base. I'm using .txt file as my database.
On the Client side, the program will ask the user to enter his/her username and password, then it will be pass to the server. After the server receive the data, server will compare the username and password with the database.. Here, i attached my code that i've done. There are a lot of problem. I hope that you can help me. THanx in advance.


I'm using string tokenizer to get the data from the database.

My problem is, there are some error, while transfering data and receiving data.

This is my server side code:
tempUsername = in.readUTF();
System.out.println(in+":"+tempUsername);

int aaa=0;
StringTokenizer st;
BufferedReader br = new BufferedReader (new FileReader ("Pass.txt"));
boolean eof = false;
while (!eof)
{
String line = br.readLine();
if(line!=null)
{
st=new StringTokenizer(line, ":");
while(st.hasMoreTokens())
{
String x=st.nextToken();
if(tempUsername.equals(x))
{
aaa=0;
String w="Your user name is correct!";
System.out.println(w);
out.writeUTF(w);
out.flush();
String no= "1";
out.writeUTF(no);
out.flush();
String y = st.nextToken();
tempPassword = in.readUTF();
System.out.println(in+":"+tempPassword);
if(tempPassword.equals("x"))
{
String z="Your password is correct!";
out.writeUTF(z);
out.flush();
break;
}
else
{
String z="Your password is incorrect!!";
out.writeUTF(z);
out.flush();
break;
}
}
else
{
String w="Your username does not exist, please register!!";
System.out.println(w);
out.writeUTF(w);
out.flush();
}
}
}
And this is my Client side code:
System.out.println("Enter your user name: ");
String name = br.readLine();
out.writeUTF(name);
out.flush();

String valid = in.readUTF();
System.out.println(valid);


String aS="";
aS=in.readUTF();
if(aS.charAt(0)=='1')
{
System.out.println("Enter your password: ");
String pass=br.readLine();
out.writeUTF(pass);
out.flush();
String vUsername=in.readUTF();
System.out.println(vUsername);
String msg2 = in.readUTF();
System.out.println(msg2);

}
else
{
continue; //i have no idea what does continue and break are use for.
}


I hope that i can get the answer as soon as possible, i've been struggling with this coding for 2 nights, but still can't find the error.