fixed indenation

This commit is contained in:
TheCutter 2014-04-19 15:53:15 +02:00
parent f00352cde0
commit 1537fc879e

View File

@ -74,15 +74,15 @@ public MySQLDatabase(ConfigurationManager config, String world, Logger logger) t
PreparedStatement verTest = null; PreparedStatement verTest = null;
try { try {
// Test if the database is up to date, if not throw a critical error // Test if the database is up to date, if not throw a critical error
verTest = this.conn.prepareStatement( verTest = this.conn.prepareStatement(
"SELECT `world_id` FROM `region_cuboid` LIMIT 0,1;" "SELECT `world_id` FROM `region_cuboid` LIMIT 0,1;"
); );
verTest.execute(); verTest.execute();
} catch (SQLException ex) { } catch (SQLException ex) {
throw new InvalidTableFormatException( throw new InvalidTableFormatException(
"region_storage_update_20110325.sql" "region_storage_update_20110325.sql"
); );
} finally { } finally {
closeResource(verTest); closeResource(verTest);
} }
@ -142,20 +142,20 @@ public MySQLDatabase(ConfigurationManager config, String world, Logger logger) t
} }
private void connect() throws SQLException { private void connect() throws SQLException {
if (conn != null) { if (conn != null) {
// Check if the connection is still alive/valid. // Check if the connection is still alive/valid.
try { try {
conn.isValid(2); conn.isValid(2);
} catch (SQLException ex) { } catch (SQLException ex) {
// Test if validation failed because the connection is dead, // Test if validation failed because the connection is dead,
// and if it is mark the connection as closed (the MySQL Driver // and if it is mark the connection as closed (the MySQL Driver
// does not ensure that the connection is marked as closed unless // does not ensure that the connection is marked as closed unless
// the close() method has been called. // the close() method has been called.
if ("08S01".equals(ex.getSQLState())) { if ("08S01".equals(ex.getSQLState())) {
conn.close(); conn.close();
} }
} }
} }
if (conn == null || conn.isClosed()) { if (conn == null || conn.isClosed()) {
conn = DriverManager.getConnection(config.sqlDsn, config.sqlUsername, config.sqlPassword); conn = DriverManager.getConnection(config.sqlDsn, config.sqlUsername, config.sqlPassword);
} }