File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Android and the fly likes Need to connect to DB and get some records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Need to connect to DB and get some records" Watch "Need to connect to DB and get some records" New topic
Author

Need to connect to DB and get some records

Vijay Rani
Greenhorn

Joined: Jun 06, 2006
Posts: 2
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.
Perry Hoekstra
Greenhorn

Joined: Dec 07, 2010
Posts: 28
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?
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1398
    
    6

For accessing sqlite db in android look into SQLiteOpenHelper class.


Swastik
Vijay Rani
Greenhorn

Joined: Jun 06, 2006
Posts: 2
Thanks Hoekstra,

We are now going to use REST-based web service.
Swastik Dey
Rancher

Joined: Jan 08, 2009
Posts: 1398
    
    6

What was your exact requirement? Connect to a web service deployed on any server or connect to local android db?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need to connect to DB and get some records
 
Similar Threads
How do I make a sevlet be called once a day?
How can i increase the perfomence of jdbc
get data from db in jsp page using struts
scenario
Fetch only 'n' records from the ResultSet