1 16 package scriptella.driver.h2; 17 18 import scriptella.jdbc.GenericDriver; 19 20 import java.sql.Connection ; 21 import java.sql.SQLException ; 22 import java.util.Properties ; 23 24 31 public class Driver extends GenericDriver { 32 public static final String H2_DRIVER_NAME = "org.h2.Driver"; 33 34 35 public Driver() { 36 loadDrivers(H2_DRIVER_NAME); 37 } 38 39 @Override 40 protected Connection getConnection(final String url, final Properties props) throws SQLException { 41 String h2Url = url; 42 if (h2Url == null || h2Url.length()==0) { h2Url = "jdbc:h2:mem:"; } 45 return super.getConnection(h2Url, props); 46 } 47 48 } 49 | Popular Tags |