This week's book giveaway is in the Spring forum.
We're giving away four copies of Java Persistence with Spring Data and Hibernate and have Cătălin Tudose on-line!
See this thread for details.
Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Need to connect to DB and get some records

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

I am new to Android world, I practiced some examples.

My query is::

we are using DB (Oracle) I want to write a program which should get all the data in a table and I want to display these records on my simulator using pagination.
when i read some set of links(in Google) sqllite will be useful to retrieve the data from DB.
but I don't know where to configure my connection properties.. and so on.
If you have any information regarding this, it will be great.
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not necessarily. Just because you are accessing records against a DB on the server does not mean you need a DB of any kind on the client side (your phone).

If you do not need to store the data on the phone, there is no need to keep in SQLite. If you just want to display the data on your phone, you would be better off defining common access paths to the data on the server (all records that match a certain date or region, all records pertaining to a particular business unit, etc), building the ability to access that data from a REST-based web service (returning the data using the JSON notation) and calling the web service from the phone (Spring offers their RestTemplate client).

So the first question you need to ask yourself. If a user brings up the app on their phone and there is no network connection, do they need to see the last good set of data brought across from a previous connection? If not, no need to store it. If you do need to display the last best set of data, ask yourself, how sensitive is the data? If the person lost the phone and someone accessed the phone and the data, is that loss critical?
 
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
For accessing sqlite db in android look into SQLiteOpenHelper class.
 
Vijay Rani
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Hoekstra,

We are now going to use REST-based web service.
 
Swastik Dey
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
What was your exact requirement? Connect to a web service deployed on any server or connect to local android db?
 
Everyone is a villain in someone else's story. Especially this devious tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic