Change Table names in derby database using entitymanager <p>Am using an APACHE DERBY database, and basing my database interactions on EntityManager, and i don't want to use JDBC class to build a query to change my tables' names (i just need to put a prefix to each new user to the application, but have the same structure of tables), such as :</p> <pre><code>//em stands for EntityManager object Query tableNamesQuery= em.createNamedQuery("RENAME TABLE SCHEMA.EMP_ACT TO EMPLOYEE_ACT"); em.executeUpdate(); // ... rest of the function's work // The command works from the database command prompt but i don't know how to use it in a program //Or as i know you can't change system tables data, but here's the code Query tableNamesQuery= em.createNamedQuery("UPDATE SYS.SYSTABLES SET TABLENAME='NEW_TABLE_NAME' WHERE TABLETYPE='T'"); em.executeUpdate(); // ... rest of the function's work </code></pre> <p>My questions are : - This syntax is correct ? - Will it work ? - Is there any other alternative ? - Should i just use the SYS.SYSTABLES and find all the tables that has 'T' as tabletype and alter their name their, will it change the access name ? Thanks in advance</p>