Public java. util. arraylist <java. util. hashtable <string, string> userlist (){
Arraylist
String SQL = "select * from user where deleted = 0 order by orderby ";
Connection con = NULL;
Statement stmt = NULL;
Resultset rs = NULL;
Try {
Con = dbconnection. getconnection ();
Stmt = con. createstatement (resultset. type_scroll_sensitive,
Resultset. concur_read_only );
Rs = stmt.exe cutequery (SQL );
while (RS. next () {
hashtable User = new hashtable ();
User. put ("autoid", String. valueof (RS. getint ("ID");
User. put ("username", Rs. getstring ("username") + ""); // if the data is null, an error occurs. Therefore, add + ""
User. put ("realname", Rs. getstring ("realname") + "");
User. put ("email", "" + Rs. getstring ("email");
User. put ("QQ", "" + Rs. getstring ("QQ");
User. put ("add R "," "+ Rs. getstring ("ADDR");
User. put ("tel", "" + Rs. getstring ("tel");
list. add (User);
}< BR >}catch (final exception e) {
}finally {
try {
If (RS! = NULL)
Rs. Close ();
If (stmt! = NULL)
Stmt. Close ();
Dbconnection. freeconnection (CON );
} Catch (final exception ex ){
}
Rs = NULL;
Stmt = NULL;
Con = NULL;
}
Return list;
}