我希望这个方法在从表中读取后返回 ap 字符串,但它似乎只返回我给它的初始值,有什么想法吗?
public String ReadAp(String val) {
SQLHelper sql = new SQLHelper();
String apStr = "Test ap initial";
try
{
sql.Init("DB_Name");
ResultSet rsData = sql.RunSelect("select AP from DB_Name.myTable where
MD='"+val+"'");
apStr = rsData.getString("AP");
}
catch(Exception exInit)
{
System.out.println("Excepted while attempting to connet to: ");
}
return apStr;
}