0

I have two databases, one that is for my web-app and the other is for my android app. I wish to occasionally allow the Android app to query and insert into the table in the database for the web-app, but do not know how to do so.

Is it simply an SQL query but with the specifying parameter for which database it is ie.

select * from webAppsDB.WebAppTable...?

How is this managed?

Sauron
  • 6,399
  • 14
  • 71
  • 136

1 Answers1

1

You could use USE statement first, like

 USE webAppsDB;

 SELECT * FROM WebAppTable
Edper
  • 9,144
  • 1
  • 27
  • 46
  • I was experimenting and tried using "SELECT * FROM databaseName.databaseTable", and it worked. Is this more or less secure than what you are suggesting? – Sauron Aug 26 '14 at 12:37
  • 1
    @Eatlon: I though initially that you have problem with the `SELECT` with database name included as you have shown in your OP. Hence I show you the alternative. Now, as far as security is concern, the only thing that I could think is, is that your version means that those databases should be in one location & one server but mine could be put in different locations. So, which means with 1 location if security is broken then all other databases would be expose. – Edper Aug 27 '14 at 10:23