String query="select * from supplier where s_com="+cha 改成 String query="select * from supplier where s_com= '"+cha+"'";这样就行了
不对 又报错javax.servlet.ServletException: General error, message from server: "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (gb2312_chinese_ci,COERCIBLE) for operation '='"
改成
String query="select * from supplier where s_com= '"+cha+"'";这样就行了