我希望此方法在從表中讀取後返回ap字符串,但它似乎只返回我給它的初始值,任何想法?從try select後返回一個sql select select
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;
}
請仔細閱讀此說明:[xkcd.com/327/](http://xkcd.com/327/) – jlordo
例外..................... – NINCOMPOOP
@jlordo。那個真棒。哈哈:) –