java/sql-dk/src/main/java/info/globalcode/sql/dk/configuration/DatabaseDefinition.java
author František Kučera <franta-hg@frantovo.cz>
Thu, 24 Oct 2019 21:43:08 +0200
branchv_0
changeset 250 aae5009bd0af
parent 238 4a1864c3e867
permissions -rw-r--r--
fix license version: GNU GPLv3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     1
/**
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     2
 * SQL-DK
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     3
 * Copyright © 2013 František Kučera (frantovo.cz)
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     4
 *
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     5
 * This program is free software: you can redistribute it and/or modify
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
250
aae5009bd0af fix license version: GNU GPLv3
František Kučera <franta-hg@frantovo.cz>
parents: 238
diff changeset
     7
 * the Free Software Foundation, version 3 of the License.
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     8
 *
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    12
 * GNU General Public License for more details.
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    13
 *
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    15
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    16
 */
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    17
package info.globalcode.sql.dk.configuration;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    18
30
b7ea47b2d4ca class for xmlns constants
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    19
import static info.globalcode.sql.dk.Xmlns.CONFIGURATION;
27
24aa5199bfd6 DatabaseConnection: just change package
František Kučera <franta-hg@frantovo.cz>
parents: 26
diff changeset
    20
import info.globalcode.sql.dk.DatabaseConnection;
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
    21
import info.globalcode.sql.dk.jmx.ConnectionManagement;
29
d66858b4b563 more configuration, more JAXB, more formatters
František Kučera <franta-hg@frantovo.cz>
parents: 27
diff changeset
    22
import java.sql.SQLException;
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
    23
import java.util.logging.Logger;
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    24
import javax.xml.bind.annotation.XmlElement;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    25
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    26
/**
155
eb3676c6929b more JavaDoc
František Kučera <franta-hg@frantovo.cz>
parents: 106
diff changeset
    27
 * Configured (but not yet connected) database connection.
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    28
 *
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    29
 * @author Ing. František Kučera (frantovo.cz)
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    30
 */
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    31
public class DatabaseDefinition implements NameIdentified {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    32
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
    33
	private static final Logger log = Logger.getLogger(DatabaseDefinition.class.getName());
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    34
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    35
	 * database name in SQL-DK configuration
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    36
	 */
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    37
	private String name;
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    38
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    39
	 * JDBC URL
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    40
	 */
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    41
	private String url;
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    42
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    43
	 * JDBC user name
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    44
	 */
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    45
	private String userName;
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    46
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    47
	 * JDBC password
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    48
	 */
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    49
	private String password;
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    50
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    51
	 * optional JDBC driver – if empty, the DriverManager is used to lookup specific Driver for
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    52
	 * given URL
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    53
	 */
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    54
	private String driver;
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    55
	/**
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    56
	 * JDBC properties
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
    57
	 */
104
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
    58
	private Properties properties = new Properties();
203
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
    59
	/**
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
    60
	 * optional definition of tunnel to the remote database
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
    61
	 */
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
    62
	private TunnelDefinition tunnel;
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    63
30
b7ea47b2d4ca class for xmlns constants
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    64
	@XmlElement(name = "name", namespace = CONFIGURATION)
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    65
	@Override
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    66
	public String getName() {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    67
		return name;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    68
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    69
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    70
	public void setName(String name) {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    71
		this.name = name;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    72
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    73
30
b7ea47b2d4ca class for xmlns constants
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    74
	@XmlElement(name = "url", namespace = CONFIGURATION)
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    75
	public String getUrl() {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    76
		return url;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    77
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    78
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    79
	public void setUrl(String url) {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    80
		this.url = url;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    81
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    82
30
b7ea47b2d4ca class for xmlns constants
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    83
	@XmlElement(name = "userName", namespace = CONFIGURATION)
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    84
	public String getUserName() {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    85
		return userName;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    86
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    87
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    88
	public void setUserName(String userName) {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    89
		this.userName = userName;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    90
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    91
30
b7ea47b2d4ca class for xmlns constants
František Kučera <franta-hg@frantovo.cz>
parents: 29
diff changeset
    92
	@XmlElement(name = "password", namespace = CONFIGURATION)
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    93
	public String getPassword() {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    94
		return password;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    95
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    96
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    97
	public void setPassword(String password) {
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    98
		this.password = password;
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
    99
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   100
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   101
	public String getDriver() {
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   102
		return driver;
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   103
	}
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   104
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   105
	public void setDriver(String driver) {
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   106
		this.driver = driver;
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   107
	}
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   108
104
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   109
	@XmlElement(name = "property", namespace = CONFIGURATION)
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   110
	public Properties getProperties() {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   111
		return properties;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   112
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   113
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   114
	public void setProperties(Properties properties) {
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   115
		this.properties = properties;
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   116
	}
245f1b88a3e6 formatter/database properties
František Kučera <franta-hg@frantovo.cz>
parents: 30
diff changeset
   117
203
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   118
	public TunnelDefinition getTunnel() {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   119
		return tunnel;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   120
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   121
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   122
	public void setTunnel(TunnelDefinition tunnel) {
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   123
		this.tunnel = tunnel;
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   124
	}
504c4ba56d1c connection tunnelling: configuration and logging
František Kučera <franta-hg@frantovo.cz>
parents: 194
diff changeset
   125
106
e9c3583580c8 use database properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
   126
	/**
155
eb3676c6929b more JavaDoc
František Kučera <franta-hg@frantovo.cz>
parents: 106
diff changeset
   127
	 * @param properties ad-hoc properties from CLI options (for the JDBC driver)
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   128
	 * @param jmxBean JMX management bean for progress reporting | null = disable JMX
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   129
	 * @return
188
54bacc7ed42b jdbc-dk-driver: include main project sources
František Kučera <franta-hg@frantovo.cz>
parents: 184
diff changeset
   130
	 * @throws java.sql.SQLException
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   131
	 */
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   132
	public DatabaseConnection connect(Properties properties, ConnectionManagement jmxBean) throws SQLException {
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   133
		return new DatabaseConnection(this, properties, jmxBean);
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   134
	}
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   135
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   136
	/**
188
54bacc7ed42b jdbc-dk-driver: include main project sources
František Kučera <franta-hg@frantovo.cz>
parents: 184
diff changeset
   137
	 * @param properties
194
629c9c7eab01 JDBC driver class can be specified in the database configuration as an optional parameter (useful especially while embedding jdbc-dk-driver into other application that does not support automatic driver discovery)
František Kučera <franta-hg@frantovo.cz>
parents: 188
diff changeset
   138
	 * @return
188
54bacc7ed42b jdbc-dk-driver: include main project sources
František Kučera <franta-hg@frantovo.cz>
parents: 184
diff changeset
   139
	 * @throws java.sql.SQLException
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   140
	 * @see #connect(info.globalcode.sql.dk.configuration.Properties, java.lang.String)
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   141
	 * With disabled JMX reporting.
106
e9c3583580c8 use database properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
   142
	 */
e9c3583580c8 use database properties
František Kučera <franta-hg@frantovo.cz>
parents: 104
diff changeset
   143
	public DatabaseConnection connect(Properties properties) throws SQLException {
179
236332caeb29 Basic JMX management/reporting – counters for commands and records
František Kučera <franta-hg@frantovo.cz>
parents: 155
diff changeset
   144
		return new DatabaseConnection(this, properties, null);
26
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   145
	}
4ec8e5534eb9 configuration basics
František Kučera <franta-hg@frantovo.cz>
parents:
diff changeset
   146
}