I have a simple servlet wich generates a piechart. It gets the data from a sql DB like this :
dataset.executeQuery("Select * From my_table");
so the chart can only show the data of my_table. what i want to do is to let the user (or the one with the permission like admin) to select a table from some DB he wants to be shown on the grafic
thats what i’ve been thinking off
Send a request to list all of the available tables in the DB and show them to the user ( checkbox or ratio buttons)
then with the selected table the chart is generated ( button click) or something like that
Well, you solution is OK. Just remember to check table name on server-side after you get it from user to prevent
SQL-injection (since malicious user can constructHTTPrequest by hand and pass in values not on the list).