Discussions

EJB programming & troubleshooting: Create new Tables at runtime

  1. Create new Tables at runtime (5 messages)

    Is there any possibility to create new tables at runtime? For example, you have different clients and every client has a own table for his products. If you create a new client, a new table for the products of the client should be created.
    Maybe there could be one EntityBean "Products" which can be mapped to different tables depending on the customer I am looking for.

    Threaded Messages (5)

  2. Why not add a client_id field to the table?
  3. Add a Client_ID field[ Go to top ]

    That could be a solution but it is not what i am looking for because there are some security aspects for this projekt.The products of each client should be seperated in different tables and every client should only have access to its own tables. So every client must have a own table.
  4. Add a Client_ID field[ Go to top ]

    Not necessarily, you can use views on the data in side the database. Consult your database documentation for CREATE VIEW

    David
  5. Add a Client_ID field[ Go to top ]

    Hi!

    I suppose you don't want to give the clientes access to the table directly (using any database browser)!

    If you build an application to view data, it will be simple to filter data in the application layer and only let the clients see their own data.

    If you have strict security, I recommend the following: Build the application for one client, and run multiple instances. (This can give problem with data updates if the clients share a lot of other data, like lists of countries, languages etc.)

    /Tomas
  6. Add a Client_ID field[ Go to top ]

    Hi!

    The client should have access to his tables via a Database-Browser, so maybe I can use the Views.It is possible to run multiple instances because the client is not allowed to update tables which are shared by other clients, only the admin should do that. But running multiple instances could reduce performance, because it is a very huge application. Have you any experience running multiple instances of an application.

    Thanks for your help!

    Kai