public SumaManager() {
		try {
			connection = DriverManager.getConnection(url);
			statement = connection.createStatement();

			ResultSet rs = connection.getMetaData().getTables(null, null, null,
					null);

			// sprawdzenie czy tabela istnieje

			while (rs.next()) {
				if ("Trumna".equalsIgnoreCase(rs.getString("TABLE_NAME"))) {
					TrumnaTableExists = true;

				} else if ("Grabarz".equalsIgnoreCase(rs
						.getString("TABLE_NAME"))) {
					GrabarzTableExists = true;

				}
			}
			if (!GrabarzTableExists)
				statement.executeUpdate(createTableGrabarz);

			if (!TrumnaTableExists)
				statement.executeUpdate(createTableTrumna);

			addTrumna = connection
					.prepareStatement("INSERT INTO Trumna (nazwa, gatunek_drewna, grabarz) VALUES (?, ?, ?);");
			addGrabarz = connection
					.prepareStatement("INSERT INTO Grabarz (imie, nazwisko) VALUES (?, ?);");
			dropTrumna = connection.prepareStatement("DROP TABLE Trumna;");
			dropGrabarz = connection.prepareStatement("DROP TABLE Grabarz;");
			getTrumna = connection.prepareStatement("SELECT * FROM Trumna;");
			getGrabarz = connection.prepareStatement("SELECT * FROM Grabarz;");
			getWhereTrumna = connection.prepareStatement("SELECT * FROM Trumna WHERE grabarz = (?);");
			selectTrumna = connection.prepareStatement("SELECT * FROM Trumna WHERE nazwa = (?);");
			selectGrabarz = connection.prepareStatement("SELECT * FROM Grabarz WHERE nazwisko = (?);");
			deleteTrumna = connection.prepareStatement("DELETE FROM Trumna WHERE grabarz = (?);");
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}