Connection conn = NULL;
String url = "", querystr = "";
Statement stmt = NULL;
Resultset rs = NULL;
string mysql_ip = "192.180.15.1";
string mysql_id = "MHT";
string mysql_pw = "19951101";
try {
class. forname ("org. gjt. mm. mySQL. driver "). newinstance ();
// class. forname ("com. mySQL. JDBC. driver "). newinstance (); // This row has the same problem as the previous one.
url = "JDBC: mysql: //" mysql_ip "/basic? User = " mysql_id " & Password = " mysql_pw " & useunicode = true & characterencoding = gb2312 ";
conn = drivermanager. getconnection (URL);
stmt = Conn. createstatement (resultset. type_scroll_sensitive, resultset. concur_updatable);
}catch (exception e) {
E. printstacktrace ();
out. println (E);
}< br> string STR = "";
querystr = "select * From station where type = '0' or type = '1' or type = '2'";
r S‑stmt.exe cutequery (querystr);
while (RS. next () {
STR = Rs. getstring ("station");
out. print (STR);
}< br> If (RS! = NULL) Rs. Close ();
If (stmt! = NULL) stmt. Close ();
If (Conn! = NULL) Conn. Close ();