All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.test.h2.H2FileBasedDatabase Maven / Gradle / Ivy

There is a newer version: 3.7.0
Show newest version
package org.kiwiproject.test.h2;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

import javax.sql.DataSource;
import java.io.File;

/**
 * Value class representing a file-based H2 database intended for use in tests. It contains the directory where the
 * database files reside and a {@link DataSource} that can be used to connect to the database. It also provides the
 * JDBC URL for the database. The username and password to use with the JDBC URL should be empty strings, e.g.
 * {@code DriverManager.getConnection(h2Database.getUrl(), "", "")}.
 */
@AllArgsConstructor
@Getter
@ToString(of = {"directory", "url"})
public class H2FileBasedDatabase {
    private final File directory;
    private final String url;
    private final DataSource dataSource;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy