Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-15-2010, 09:47 AM   #1 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 3
jnonthanawong is on a distinguished road
Default How can I connect my iPhone app to Oracle DB

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!!
jnonthanawong is offline   Reply With Quote
Old 09-15-2010, 12:19 PM   #2 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

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
JasonR is offline   Reply With Quote
Old 09-15-2010, 01:00 PM   #3 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 3
jnonthanawong is on a distinguished road
Default

Quote:
Originally Posted by JasonR View Post
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?

Thank a tons.
Jitpanu
jnonthanawong is offline   Reply With Quote
Old 09-15-2010, 01:05 PM   #4 (permalink)
Super Moderator
 
Join Date: Oct 2009
Location: San Diego, CA
Posts: 1,586
JasonR is on a distinguished road
Default

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.
JasonR is offline   Reply With Quote
Old 09-15-2010, 03:44 PM   #5 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 3
jnonthanawong is on a distinguished road
Default

Quote:
Originally Posted by JasonR View Post
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.

Big thank to you, JasonR
jnonthanawong is offline   Reply With Quote
Reply

Bookmarks

Tags
connect, database, iphone, oracle

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 326
19 members and 307 guests
2ndSegment, bignoggins, cayladv57, cgokey, dermotos, djohnson, Domele, guusleijsten, Hamad, heshiming, linkmx, markuschow, Objective Zero, pungs, Rudy, Sloshmonster, teebee74, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:53 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0