Hi all,

More information found:
The database could be written by the execSQL method, however, it could
not be read from the query method.

A "Write-Only" database? that's weird...

I open my database with SQLiteDatabaseHelper and SQLiteDatabase as
below:

                mDbHelper = new DatabaseHelper(mCtx);
                mDb = mDbHelper.getWritableDatabase();

Is it possible that the read-access is "locked" by the first database?
I'm sure that I close my database with mDbHelper.close() after each
query...

On 2月12日, 下午4時00分, yukinoba <ckmagic...@gmail.com> wrote:
> to dear all,
>
> I just found a same open problem as the one I 
> met:http://groups.google.com/group/android-developers/browse_thread/threa...
>
> Hope this could help
>
> Any suggestions and ideas are welcome, Plz :-)
>
> Best regards,
> Nicholas
>
> On 2月12日, 下午2時49分, yukinoba <ckmagic...@gmail.com> wrote:
>
> > I have a new question for this:
>
> > Can there have multiple databases created in the same application or
> > service?
> > I have 2 databases, one for query and store the information about
> > phone numbers, and one for the names.
> > However, the ealier one works fine, and the later one stucks in the
> > method and never get rid of that status.
>
> > So, my question is, does each application / service have been limited
> > to have only one single database?
>
> > Plz provides any help or suggestion
>
> > Best regards,
> > Nicholas
>
> > On 2月12日, 上午9時23分, yukinoba <ckmagic...@gmail.com> wrote:
>
> > > Could someone give a little bit information about any possible
> > > solution or hint?
> > > I have searched in this forum and nothing about this topic :-(
>
> > > On 2月11日, 下午6時44分, yukinoba <ckmagic...@gmail.com> wrote:
>
> > > > More information:
>
> > > > Most of the data (surname) here are utf-8 encoded, does this cause the
> > > > error?
> > > > Could anyone tell me how to push an utf-8 String in the SQL statement?
>
> > > > Thanks for any help! :-)
>
> > > > Best regards,
> > > > Nicholas
>
> > > > On 2月11日, 下午5時18分, yukinoba <ckmagic...@gmail.com> wrote:
>
> > > > > to dear all Android developers,
>
> > > > > I'm dealing with database operation on Android recently.
> > > > > However, there has a problem troubles me that the query method in
> > > > > SQLiteQueryBuilder infinitely loops and has no return.
>
> > > > > The operation code is like below:
>
> > > > > //------------ CODE section --//
> > > > > SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
>
> > > > > qb.setTables(TABLE.NAME);
> > > > > qb.setProjectionMap(TABLE.ProjectionMap);
> > > > > qb.appendWhere(TABLE._ID + "=" + id + " AND "
> > > > >         + TABLE.SURNAME + "='" + surname + "'");
>
> > > > > String orderBy = TABLE._ID + " ASC";
> > > > > String[] projection = new String[] {
> > > > >         TABLE._ID
>
> > > > > };
>
> > > > > mDbHelper = new DatabaseHelper(mCtx);
> > > > > mDb = mDbHelper.getWritableDatabase();
>
> > > > > Cursor c = qb.query(mDb, projection, null, null, null, null, orderBy);
> > > > > //------------ CODE section --//
>
> > > > > However, it stuck in the query and never return back, and there has
> > > > > neither exceptions nor any error messages from the LogCat. Does there
> > > > > any mistake I make in my code?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to