86878889909192
/** * Returns a new Database that uses given {@link DataSource} to retrieve connections. */ @NotNull public static Database forDataSource(@NotNull DataSource dataSource) { return new Database(new DataSourceConnectionProvider(dataSource)); }
157158159160161162163
/** * Constructs a new Database that uses given {@link DataSource} and auto-detects the dialect to use. */ public Database(@NotNull DataSource dataSource) { this(new DataSourceConnectionProvider(dataSource)); }
164165166167168169170
/** * Constructs a new Database that uses given {@link DataSource} and {@link Dialect}. */ public Database(@NotNull DataSource dataSource, @NotNull Dialect dialect) { this(new DataSourceConnectionProvider(dataSource), dialect); }
130131132133134135136
return getClass().getName(); } @NotNull public static Dialect detect(@NotNull DataSource dataSource) { return detect(new DataSourceConnectionProvider(dataSource)); }