• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to convert multiple table in sqlite into a JSON object

 
Greenhorn
Posts: 5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm facing difficulties when i want to convert two table(multiple) in sqlite into a JSON object. I manage to convert  a sqlite table to a json object. I've googling and mostly those site recommend to use Gson but i don't have single idea how to do it when sqlite involves. Can you give me some example how to convert it to JSON object? It's easier to understad from example. thanks

here's my code to convert single table:



and this is my DatabaseHelper table:


 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Everything will remain same, probably a join between the tables should do the trick, i.e. only your sql will change.
 
Adina Haziza
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
But still i cannot get JSON object after i join the table. could you check it please?



the log cat :

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you see any of the other log statements from inside that loop?

If not then it looks like your query is returning no data.
 
reply
    Bookmark Topic Watch Topic
  • New Topic