开发者

multiple tables in database

开发者 https://www.devze.com 2023-03-01 08:39 出处:网络
I have to create an application a kind of client-server thing,both on android!!! My client is moving on a direction and the GPS data of the route is stored in a database.

I have to create an application a kind of client-server thing,both on android!!!

My client is moving on a direction and the GPS data of the route is stored in a database.

Now,I can have more than one client.The thing is that after the client connects to server,

this one has to read the data and store it in its database!

The GPS data that the client retrieves to server describes a route on the map.This data is

stored at the server for late proccessing.

NOW this is how I imagine the database:

First Tabel

_id route

Second Tabel(the name is _id from the first tabel)

_id longitude latitude

Each time a client connects to the server(or the same client with different GPS data) I insert a row in the first tabel which describes the route (source destination) and the latitude and longitud开发者_StackOverflowe describing that is stored in the second tabel.But when comes another client an connects I insert a new row in the first tabel and the data in another tabel,a third one similar with the second one.

Te problem is that I don't know how to create spontanously new tabels.I've seen example with a number fixed of tables...

Has anyone any idea of how could I do that?????


What you need is a user table. When a client connects/registers create a new user entry in the table and retain the _id. Then supply it as column data when writing to the other tables.

eg

_id user

_id route user_id

_id longitude latitude user_id

where user_id is the _id of the user from the user table.

0

精彩评论

暂无评论...
验证码 换一张
取 消