Sure, good point. You were right, 'sqlite3' command does NOT complain if the 
database file doesn't exist, it just creates it.


However, what confused me in the first place was the example below which was 
given on the android website:

 
$ adb -s emulator-5554 shell
# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
SQLite version 3.3.12
Enter ".help" for instructions
.... enter commands, then quit...
sqlite> .exit
Correspondingly, I thought that any database should have the ".db" extension, 
yet I've found out later on that this is not necessarily the case. So, the 
bottom line is one should check "mydatabase" using the command 

 

sqlite3 /data/data/com.android.myapplication/databases/mydatabase

 

Cheers,

 

Emre
 
> Date: Tue, 18 Aug 2009 13:24:10 -0700
> Subject: [android-developers] Re: Accessing the sqlite3 database via shell ?
> From: marc...@android.com
> To: android-developers@googlegroups.com
> 
> 
> It might help others if you told us what the problem and solution were.
> 
> 
> On Tue, Aug 18, 2009 at 12:41 PM, Emre A. Yavuz<eayl...@hotmail.com> wrote:
> > Problem solved, thanks for the comments.
> >
> > Emre
> >
> > ________________________________
> > From: eayl...@hotmail.com
> > To: android-developers@googlegroups.com
> > Subject: [android-developers] Re: Accessing the sqlite3 database via shell ?
> > Date: Tue, 18 Aug 2009 13:05:26 -0400
> >
> > Yes I am. I tested it and verified that it is the database file that my
> > application has created.
> >
> > Any other suggestions ?
> >
> > Emre
> >
> >> Date: Tue, 18 Aug 2009 09:16:23 -0700
> >> Subject: [android-developers] Re: Accessing the sqlite3 database via shell
> >> ?
> >> From: marc...@android.com
> >> To: android-developers@googlegroups.com
> >>
> >>
> >> On Tue, Aug 18, 2009 at 8:05 AM, Emre A. Yavuz<eayl...@hotmail.com> wrote:
> >> >
> >> > Hi,
> >> >
> >> > I've been using the "SQLiteOpenHelper" class to create/open a database
> >> > for
> >> > my application. During the initialization process, I've been adding two
> >> > tables to it and fill one of them with some data. Everything seems to be
> >> > working fine and I'm getting no errors or whatsoever when I run my code.
> >> >
> >> > Then I try to access the same database via shell using the
> >> >
> >> > "adb -s emulator-XXXX shell"
> >> >
> >> > command followed by
> >> >
> >> > "sqlite3 /data/data/com.android.myapplication/databases/mydatabase.db"
> >>
> >> Are you sure that is actually the name of your database file? The
> >> 'sqlite3' command will not complain if the file doesn't exist, it will
> >> just create it.
> >>
> >> > and I am able to see that the database is created. However, when I want
> >> > to
> >> > see the contents; say the tables using ".tables", there seems to be
> >> > nothing
> >> > in the database.
> >>
> >> That sounds like what would happen if you specified the wrong filename.
> >>
> >> > I debug my code to make sure that my code executes the lines where I
> >> > created
> >> > these tables so I am wondering what the problem might be.  I haven't
> >> > seen
> >> > anything with respect to that in the references, but do we have to
> >> > commit
> >> > after using the "execSQL" method ? Or am I missing something else ?
> >> >
> >> > Thanks for your help in advance,
> >> >
> >> > Emre
> >> >
> >> >
> >> >
> >> > ________________________________
> >> > Attention all humans. We are your photos. Free us.
> >> > >
> >> >
> >>
> >> </html
> > >
> >
> 
> > 

_________________________________________________________________
Stay on top of things, check email from other accounts!
http://go.microsoft.com/?linkid=9671355
--~--~---------~--~----~------------~-------~--~----~
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