The forum will experience an outage sometime between February 10 at 7:00pm EST and February 12 at 11:59 EST for installation of security updates. The actual time and duration of the outage are unknown but attempts will be made to minimize the downtime. We apologize for any inconvenience.

How do connect to ultralite database that is on my sd card.

asked 16 Apr '12, 13:39

Tejasvi's gravatar image

Tejasvi
1222
accept rate: 0%


Something like this will do:

Configuration config = DatabaseManager.createConfigurationFileAndroid(
    "/sdcard/Android/data/app.package.name/files/test.udb", getApplicationContext() );
Connection conn = DatabaseManager.connect( config );

permanent link

answered 16 Apr '12, 13:58

Andy%20Quick's gravatar image

Andy Quick
2.1k2436
accept rate: 43%

I tried this but i get this error "com.ianywhere.ultralitejni12.implementation.JniException: UltraLiteJ Error[-954]: The database '/data/data/Tejash.Agni/goroute.udb' was not found" where goroute is my file name and tejash.agni is package in which database is stored

(16 Apr '12, 14:06) Tejasvi
Replies hidden

File paths in the Android file system are case-sensitive. Could that be the problem?

(16 Apr '12, 14:15) Andy Quick
2

You indicated that you were interested in accessing the database on an SDCard. The error you report looks like an internal file storage reference. A reference to an SDCard location will look more like:

    /mnt/sdcard/Android/data/com.sybase.repro/files/database.udb

I generally use the following approach in code:

    String dbPath = getApplicationContext().getExternalFilesDir(null)
            + "/database.udb";

For internal storage, the code I use looks like:

    String dbPath = getApplicationContext().getFilesDir()
            + "/database.udb";

and the resulting directory looks like:

    /data/data/com.sybase.repro/files/database.udb
(16 Apr '12, 15:05) Chris Keating
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×59

question asked: 16 Apr '12, 13:39

question was seen: 1,279 times

last updated: 16 Apr '12, 15:06