0

I am creating a mobile app in RAD Studio XE 6 to handle a remote Oracle Database that is stored in a server.

I am completely new in RAD Studio and newer in Oracle Databases. I have read a lot everywhere about how to set up a TSQLConnection using a Oracle Server, but simply I can not make it work.

I am trying to follow this tutorial, but in that tutorial, they use interbase. I need to use Oracle, but as I mention I cannot do it.

I have read about a file called tnsnames.ora, about the Oracle client I need to install, and tons of information that simply is not working. I am getting firewall errors among other kind of problems.

I am completely confused at this moment.

Do somebody know if there is some information step by step that could help me?

Sir Rufo
  • 18,395
  • 2
  • 39
  • 73
  • Setting up Android access to a database is a very tall order for your first Delphi project. You would do better first to attempt to create a Delphi Win32 application that opens a database table and displays a few rows from it. There are many tutorials about that around. Creating a web service as recommended in the (good) answer you've already got is also not ideal for a first project, as you need a client to test it with. You would do better to build up to your Android project in much smaller steps. – MartynA Jul 24 '14 at 06:35
  • I don't disagree with the comment above, or the answer below, but Step 1 should be to get a simple client-server connection working from inside the firewall. After that, look at the options. A Web service would be a strong candidate, a vpn solution might do the job, a briefcase-model app could work ... all depends on what the app does. – Hugh Jones Jul 24 '14 at 08:49
  • Are you able to connect using SQLPlus? – Hugh Jones Jul 24 '14 at 09:40
  • Thanks for your comments guys. All of them were really helpfull, since I have no idea of where to start from. So, I suppose I need to find out how to create a web service that provides the data to my client app. I read about datasnap something, I think I will check that subject. Thanks again. – Ricardo Rodriguez Jul 24 '14 at 16:58
  • I have not tried using SQLPlus, I will check that too. Thanks! – Ricardo Rodriguez Jul 24 '14 at 17:00
  • Thanks guys for all your comments and recomendations. I followed all of your smart comments, and I created a DATA Snap web service that did what I needed, it is working now, actually I am leaving the link in case where is the video I watched to make this work (in case there is someone in my situation). http://lfgonzalez.visiblogs.com/2014/02/soporte-de-dataset-para-datasnap-rest-ejemplo-usando-cbuilder-xe5-y-client-ios/ – Ricardo Rodriguez Jul 28 '14 at 04:32

1 Answers1

3

Do not directly connect an Android device to a production database. This is insecure for two reasons.

1)It means you can't firewall off your database, and must leave it on the open internet. This increases the ability of hackers to attack it directly.

2)To connect to the db, you need login info. That means you have to put it in the app. This makes it trivial for an attacker to decompile and get it. At that point you've handed them your database. The correct way to fix this is to put a webservice between them, and have the Android app only directly connect to the webservice. Then only the webservice, which is safe on your own servers, needs to know the password.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127