如何在网络硬盘上创建数据库?

时间:2014-04-29 08:22:27

标签: android android-sqlite android-wireless

这是我如何尝试在网络硬盘上创建一个sqlite数据库(希捷无线)

    public DBControllerClient(Context applicationcontext) {
    super(applicationcontext,"smb://172.25.0.1/Public-01/Documents/NouveauDB.db", null, 1);
    Log.d(LOGCAT,"Created DBController");
}

Firt:我可以这样做来创建db吗?

当我试图查看所有数据时,我有这样的错误:file" smb://172.25.0.1/Public-01/Documents/NouveauDB.db"包含路径分隔符。

这是我的logcat:

04-29 10:08:47.310: E/AndroidRuntime(4405): FATAL EXCEPTION: main
04-29 10:08:47.310: E/AndroidRuntime(4405): java.lang.RuntimeException: Unable to start     activity ComponentInfo{org.opencv.samples.facedetect/com.client.FicheClient1}: java.lang.IllegalArgumentException: File smb://172.25.0.1/Public-01/Documents/NouveauDB.db contains a path separator
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2194)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2244)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread.access$600(ActivityThread.java:141)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1246)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.os.Handler.dispatchMessage(Handler.java:99)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.os.Looper.loop(Looper.java:137)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread.main(ActivityThread.java:5060)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at java.lang.reflect.Method.invokeNative(Native Method)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at java.lang.reflect.Method.invoke(Method.java:511)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at dalvik.system.NativeStart.main(Native Method)
04-29 10:08:47.310: E/AndroidRuntime(4405): Caused by: java.lang.IllegalArgumentException: File smb://172.25.0.1/Public-01/Documents/NouveauDB.db contains a path separator
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ContextImpl.makeFilename(ContextImpl.java:1992)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ContextImpl.validateFilePath(ContextImpl.java:1976)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:866)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:229)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at com.client.DBControllerClient.getAllClient(DBControllerClient.java:126)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at com.client.FicheClient1.onCreate(FicheClient1.java:370)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.Activity.performCreate(Activity.java:5146)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
04-29 10:08:47.310: E/AndroidRuntime(4405):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2156)
04-29 10:08:47.310: E/AndroidRuntime(4405):     ... 11 more

我该如何解决我的问题?

thx for your lights

0 个答案:

没有答案