This works on java6 but not in java5
*/
package org.sonar.server.database;
+import org.h2.Driver;
+
import org.apache.commons.lang.StringUtils;
import org.h2.tools.Server;
import org.slf4j.Logger;
private void createDatabase(File dbHome, String user, String password) throws SQLException {
String url = String.format("jdbc:h2:%s/sonar;USER=%s;PASSWORD=%s", dbHome.getAbsolutePath(), user, password);
+ DriverManager.registerDriver(new Driver());
DriverManager.getConnection(url).close();
}
*/
package org.sonar.server.database;
+import org.h2.Driver;
+
import org.junit.Test;
import org.sonar.api.config.Settings;
import org.sonar.api.database.DatabaseProperties;
try {
String driverUrl = String.format("jdbc:h2:tcp://localhost:%d/sonar;USER=login;PASSWORD=pwd", port);
+ DriverManager.registerDriver(new Driver());
DriverManager.getConnection(driverUrl).close();
} catch (Exception ex) {
fail("Unable to connect after start");