列表项如何在黑莓手机
我开发的应用程序,在使用精简版平方米数据库中创建数据库。这在模拟器上正常运行。但是当我们将应用程序部署在黑莓Curve 8520手机上时。告诉我们数据库不存在。任何人都知道答案,请快速反应...
我的代码 - >
public static void insertData(String pass , String cpass)
{
boolean fl=false;
String root = null;
MainScreen ms = new MainScreen();
Enumeration e = FileSystemRegistry.listRoots();
while (e.hasMoreElements())
{
root = (String)e.nextElement();
if(root.equalsIgnoreCase("store/"))
{
fl=true;
}
}
if(!fl)
{
UiApplication.getUiApplication().invokeLater(new Runnable()
{
public void run()
{
Dialog.alert("This application requires an SD card to be present." +
"Exiting application...");
System.exit(0);
}
});
}
else
{
String dbLocation = "C:/om12345/sql/res/store/";
// Create URI
// Statement st=null;
try
{
URI myURI = URI.create("file:///store/home/user/databases/database.sqlite");
//URI myURI1=URI.
d = DatabaseFactory.create(myURI);
Statement st = d.createStatement("insert into Admin (pass, Cpass) values('"+ pass+"','"+cpass+"')");
st.prepare();
st.execute();
st.close();
d.close();
//ms.add(new RichTextField ("tata" + "tata1"));
// UiApplication.getApplication.invokeLater(pushScreeen(ms));
}
catch (Exception e1)
{
System.out.println(e1.getMessage());
e1.printStackTrace();
}
}
的代码可以使用一些清洗一看。 dbLocation字符串没有被传递给DatabaseFactory.create(),所以建议不会有帮助。请给出 – 2012-07-21 19:42:30
,你给出适当的答案这个问题。作为数据库路径 – 2012-08-03 16:56:07
我想说,你可以告诉我一步一步解决这个问题。请问..... – 2012-08-05 14:53:52