本人尝试这在android中这样写,可是连接出错,求正确的写法
try
{
File databaseFile = LauncherActivity.this.getDatabasePath("test.sqlite");
if (!databaseFile.exists() && !databaseFile.createNewFile())
Log.e(TAG, "nCreate: " + "创建数据库失败: " + databaseFile.getAbsolutePath());
SimpleDataSource simpleDataSource = new SimpleDataSource();
simpleDataSource.setJdbcUrl("jdbc:sqldroid:" + databaseFile.getAbsolutePath());
simpleDataSource.setDriverClassName("org.sqldroid.SqldroidDriver");
Dao dao = new NutDao(simpleDataSource);
dao.create(AppEnvApplicationInfo.class, true);
}
catch (Exception e)
{
Log.e(TAG, "onCreate: " + e.getLocalizedMessage(), e);
}