133 * @param newName New name
134 */
135 public void renameTable(final String oldName, final String newName) {
136 try (Connection connection = getConnection(); PreparedStatement ps = connection.prepareStatement("RENAME " + oldName + " TO " + newName)) {137 ps.executeUpdate();
138 final Table table = tableRegister.get(oldName);
139 if (table != null) {
118 * @param table Name of table
119 */
120 public void deleteTable(final String table) {
121 try (Connection connection = getConnection(); PreparedStatement ps = connection.prepareStatement("DROP TABLE " + table)) {122 ps.executeUpdate();
123 tableRegister.remove(table);
124 } catch (final SQLException e) {
Multiple variables (or fields) should not be declared on the same line.
Declaring more than one variables (or fields) on the same line makes the code harder to read. Things might get more confusing if some of those variables are initiliazed and some of them are not.
class Klass {
private int a, b = 20;
private void method() {
double d1, d2 = 3.5, d3;
// ... rest of the code
}
}
Consider declaring one variable per line.
class Klass {
private int a;
private int b = 20;
private void method() {
double d1;
double d2 = 3.5;
double d3;
// ... rest of the code
}
}