NullPointerException - mysql result... why?

well i will show u part of my code and maybe u will tell me what should i change...:/

Server:

publicclass Serverextends UnicastRemoteObjectimplements ServerFace{

Vector student;

public Vector getStudents()throws RemoteException{

try{

System.out.println("driver...");

Class.forName(driver).newInstance();

System.out.println("connecting to host...");

Connection con = DriverManager.getConnection(url,"usr","pswd");

System.out.println("query");

Statement stmt = con.createStatement();

ResultSet rs = stmt.executeQuery("SELECT * FROM Student");

System.out.println("select");

while (rs.next()){

int id = rs.getInt("id");

String name = rs.getString("name");

String surname = rs.getString("surname");

System.out.println("" + id +" " + name +" " + surname +"\n");

student.add(new Student(id,name,surname));

System.out.println("student added");

}

rs.close();

stmt.close();

con.close();

}catch(Exception ex){

System.err.println("Exception: " + ex);

}

return student;

}

Client:

Vector student = server.getStudents();

Student class have 3 attributes (id, name, surname)

well here is server output:

driver...

connecting to host...

query

select

1 aaa bbb

Exception: java.lang.NullPointerException

so the error is in here:

student.add(new Student(id,name,surname));

thx for all answers

[2571 byte] By [tesga] at [2007-10-2 9:46:21]
# 1
> Vector student;The Vector student is null here and it is never initialized in your code. This is not related to RMI. :)> while (rs.next()){Add a line before the while loop.student = new Vector();
aniseeda at 2007-7-16 23:51:48 > top of Java-index,Core,Core APIs...
# 2
omg what a silly mistake...:/ thx a lot man...
tesga at 2007-7-16 23:51:48 > top of Java-index,Core,Core APIs...