here is the method which cozing exception..
i use jdbcodbc birdge for acess database.
public Vector getBuddyList(int userId){
Statement statement;
String query="select buddylist.*, chater.nick from buddyList, chater where buddylist.id="+userId+" and chater.user_id=buddylist.buddy_id ";
Vector buddyList=new Vector();
try{
statement=connection.createStatement();
System.out.println("DBConnection:getBuddyList:query ="+query);
ResultSet rs=statement.executeQuery(query);
System.out.println("DBConnection:getBuddyList: executed :");
while(rs.next ()){
Buddy buddy=new Buddy();
buddy.setBuddyId (rs.getInt("buddy_id"));
buddy.setId (rs.getInt("id"));
buddy.setBlock (rs.getByte("isblock"));
buddy.setStatus (rs.getByte("status"));
buddyList.addElement(buddy);
}
return buddyList;
}catch(SQLException sql){
String errorMessage=
"DBConnection:getBuddyList
roblem in query :"+sql;
System.out.println(errorMessage);
}
return null;
}
Qasim Shabbir
SCJP