我有一个在 BlackBerry OS 7.0 下运行良好的应用程序,但是当我在 BlackBerry OS 6.0 下运行相同的应用程序时,SqLite 光标立即到达数据的末尾,因此我无法从数据库中获取任何数据。
public static Vector GetProducts(String sysID) {
Bitmap img = null;
try {
Statement st = d
.createStatement("SELECT * FROM Product where systemSerID=?");
st.prepare();
st.bind(1, sysID);
st.execute();
Cursor c = st.getCursor();
Products products;
Vector pro = new Vector();
while (c.next()) {
Row r = c.getRow();
products = new Products();
products.setSystemServiceID(r.getString(1));
products.setSystemServiceName(r.getString(2));
products.setProductID(r.getString(3));
products.setProductName(r.getString(4));
products.setProductDesc(r.getString(5));
products.setProductType(r.getString(devil));
// products[i].setProductType("1");
products.setBatchID(r.getString(7));
products.setMinValue(r.getString(music));
products.setMaxValue(r.getString(9));
products.setImageURL(r.getString(10));
System.out.println(" retrived from database.");
pro.addElement(products);
}
c.close();
st.close();
return pro;
} catch (DatabaseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
} catch (DataTypeException e) {
// TODO Auto-generated catch block
e.printStackTrace();
return null;
}
}