Skip to content

Database Service attributes #388

@bmaschio

Description

@bmaschio

From the DbService
it seems that the attributes are applied only in case of enbedding

	if( isEmbedded ) {
		connectionString = "jdbc:" + driver + ":" + databaseName;
		if( !attributes.isEmpty() ) {
			connectionString += ";" + attributes;
		}
		if( "hsqldb".equals( driver ) ) {
			connection = DriverManager.getConnection(
				connectionString,
				username,
				password );
		} else {
			connection = DriverManager.getConnection( connectionString );
		}
	} else {
		if( driver.startsWith( "hsqldb" ) ) {
			connectionString = "jdbc:" + driver + ":" + driver.substring( driver.indexOf( '_' ) + 1 ) + "//"
				+ host + (port.isEmpty() ? "" : ":" + port) + separator + databaseName + "?characterEncoding="
				+ encoding;
		} else {
			connectionString =
				"jdbc:" + driver + "://" + host + (port.isEmpty() ? "" : ":" + port) + separator + databaseName
					+ "?characterEncoding=" + encoding;
		}
		connection = DriverManager.getConnection(
			connectionString,
			username,
			password );
	}

Am I wronge

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions