How to use a tablename variable for a java prepared statement insert [duplicate]

You can’t. You need to contruct the sql with string concatenation/placeholder with String.format. prepared statement is for the column values not for table name.

Leave a Comment