rs = sql1.executeQuery("select * from table1 where 编号 ="+变量名);
这样写就可以了
如果编号是字符型那就得这样写
rs = sql1.executeQuery("select * from table1
where 编号 ='"+变量名+"'");
int iBianHao;
rs = sql1.executeQuery("select * from table1 where 编号 = "+iBianHao);
String strBianHao
rs = sql1.executeQuery("select * from table1 where 编号 = '"+strBianHao+"'");