java/sql-dk/src/info/globalcode/sql/dk/DatabaseConnection.java
author František Kučera <franta-hg@frantovo.cz>
Sat, 21 Dec 2013 22:22:30 +0100
branchv_0
changeset 28 57c44a6baedb
parent 27 24aa5199bfd6
child 29 d66858b4b563
permissions -rw-r--r--
DatabaseConnection: connect JDBC

/**
 * SQL-DK
 * Copyright © 2013 František Kučera (frantovo.cz)
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package info.globalcode.sql.dk;

import info.globalcode.sql.dk.configuration.DatabaseDefinition;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Ing. František Kučera (frantovo.cz)
 */
public class DatabaseConnection {

	private DatabaseDefinition databaseDefinition;
	private Connection connection;

	public DatabaseConnection(DatabaseDefinition databaseDefinition) throws SQLException {
		this.databaseDefinition = databaseDefinition;

		connection = DriverManager.getConnection(databaseDefinition.getUrl(), databaseDefinition.getName(), databaseDefinition.getPassword());
	}
}