//#endif JAVA6
public static Connection getConnection(String url,
Properties info) throws SQLException {
final HsqlProperties props = DatabaseURL.parseURL(url, true, false);
if (props == null) {
// supposed to be an HSQLDB driver url but has errors
throw JDBCUtil.invalidArgument();
} else if (props.isEmpty()) {
// is not an HSQLDB driver url
return null;
}
long timeout = 0;
if (info != null) {
timeout = HsqlProperties.getIntegerProperty(info, "loginTimeout", 0);
}
props.addProperties(info);
if (timeout == 0) {
timeout = DriverManager.getLoginTimeout();
}
// @todo: maybe impose some sort of sane restriction
// on network connections regarless of user
// specification?
if (timeout == 0) {
// no timeout restriction
return new JDBCConnection(props);
}
String connType = props.getProperty("connection_type");
if (DatabaseURL.isInProcessDatabaseType(connType)) {
return new JDBCConnection(props);
}