Conversation
Also implemented for debugQuery function.
|
|
||
| return dataframe; | ||
| else { | ||
| String q = "SELECT * FROM " + query; |
There was a problem hiding this comment.
PreparedStatement should be initialised with ? for the table name, then setString should be invoked to add the table name
There was a problem hiding this comment.
This apparently cannot be done for table names.
https://stackoverflow.com/questions/11312155/how-to-use-a-tablename-variable-for-a-java-prepared-statement-insert
There was a problem hiding this comment.
A reasonable thing to do might be to:
- Retrieve all table names from the db connection
- Check that the user submitted table name matches a table from the db
- Signal an error if not
There was a problem hiding this comment.
That's a good idea! Maybe this can be done in the SQLReader constructor storing the list of tables as a private variable. In any case, we can create a separate issue for this problem mentioning also other security concerns due to the fact that a custom SQL query can be provided
Also implemented for debugQuery function. Has been tested with the r2rml examples. Closes #17.