Creating columns in tables through variables in java

1

Hello, I would like the help to solve the following problem: I have a table, but its columns can be defined by user-defined variables. For example, the user sets a1, b1 and c1, from there the program creates a table that must contain a column for each variable. Thus, the user can define up to n columns. For the construction of the table I am using netbeans interfaces. I'm trying to find a solution for this a while ago .... could anyone help me?

    
asked by anonymous 07.07.2016 / 16:47

1 answer

1

Do not create columns. If you need the user to create variables and specify multiple values for each of them, create a new table that allows you to define the variables for each user. The fields are:

  • User Id
  • Variable name

Then create another table to store the values, with the fields:

  • User Id
  • Variable name
  • Variable value

So, in this second table, it can have multiple values.

If the user can only define one value per variable, simply use a new table as the last one:

  • User Id
  • Variable name
  • Variable value
08.07.2016 / 06:00