Hi, I'm very new to iPhone development and I have been googling for many day to know how can my iPhone application access to the Oracle database.
I have got main two results to done this;
1. Direct access to Oracle DB - which I have no idea how to do this?
2. Create a web server such as JDBC to be place between iPhone and Oracle DB so what I have to do is only with web server - again I have no idea.
(plz correct me if I'm wrong)
until now I still dont get a clear picture of these and which way should I use and why?
thx in advance!!
1. Allowing direct access to your DB from the outside is a security risk unless you really know what you are doing. I don't recommend it.
2. Writing a web service in a language such as PHP or Ruby on Rails that accesses the DB for you is usually considered the best idea. But there are security concerns here as well.
Since you are using Oracle, I'm assuming there might be critical data in your DB. If your DB contains any serious data, I would recommend you learn how to write a secure web front end before you consider accessing it from your iPhone app, or you could open up your data to unscrupulous users. Or, even better, have someone who knows how to write a secure webservice make one for you to access.
On the other hand, if your DB contains game high scores, go look in the tutorial section for how to access high scores from PHP.
BTW, JDBC is a technology your web server would use to access the database. You will still need a webserver like Apache.
Last edited by JasonR; 09-15-2010 at 12:20 PM.
Reason: JDBC into
1. Allowing direct access to your DB from the outside is a security risk unless you really know what you are doing. I don't recommend it.
2. Writing a web service in a language such as PHP or Ruby on Rails that accesses the DB for you is usually considered the best idea. But there are security concerns here as well.
Since you are using Oracle, I'm assuming there might be critical data in your DB. If your DB contains any serious data, I would recommend you learn how to write a secure web front end before you consider accessing it from your iPhone app, or you could open up your data to unscrupulous users. Or, even better, have someone who knows how to write a secure webservice make one for you to access.
On the other hand, if your DB contains game high scores, go look in the tutorial section for how to access high scores from PHP.
BTW, JDBC is a technology your web server would use to access the database. You will still need a webserver like Apache.
Thank in advance JasonR,
I heading to the second approach, thank for the security issue for second approach too(never concerned that before).
At the beginning I thought I can connect my iPhone app to DB through only web service. So if I connecting my iPhone app to JDBC, I still need to connect to a webserver(Apache) and web server will connect to my DB, am I right? BTW I plan to parse the request from my app in XML format and get by XML too, could it be possible by JSON or any suggestion?
In theory, you could connect to your database straight by JDBC without a web server, but besides the security issue, there's no JDBC drivers for the iPhone, so you'd have to write it yourself. Which is another good reason to use a webservice, since there's lots of code examples showing how to do it.
The choice between XML and JSON is actually made when you write the webservice. Most webservice languages have libraries for both. JSON usually generates less traffic, so it's a good choice.
In theory, you could connect to your database straight by JDBC without a web server, but besides the security issue, there's no JDBC drivers for the iPhone, so you'd have to write it yourself. Which is another good reason to use a webservice, since there's lots of code examples showing how to do it.
The choice between XML and JSON is actually made when you write the webservice. Most webservice languages have libraries for both. JSON usually generates less traffic, so it's a good choice.
You answer me at the right spots, now I can figure my application structure. I still have to work hard on Objective-C, Xcode and web service.