大家都来看看..我是哪里错了.
大真 2007-08-13 01:37:04 public boolean findLensName(String companyname){
jdbcConnection(); //连接数据库
ResultSet rs=null;
try{
String str="select lens.lensname from lens,company where company.company='"+companyname+"' and company.companyid=lens.companyid";
System.out.println(str);
if(st.execute(str)){
System.out.println(rs.getString("lensname"));
System.out.println("asdfasdf");
return true;
}
System.out.println("<<<<<>>>s");
}catch(Exception e){
e.printStackTrace();
e.getMessage();
}
return false;
}
这个方法中参数是表中的记录.
为什么if()中的内容不执行呢..
这个sql语句是对的啊..我在mysql中检验过了.
怎么放在方法中,就不好用了呢.