GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — DataSource

This repository was archived by the owner on Dec 8, 2023. It is now read-only.

DataSource

Jump to bottom
Tiago Simão edited this page Sep 6, 2016 · 1 revision

Drowsy DataSource

org.irenical.drowsy.datasource.DrowsyDataSource is a DataSource implementation with built-in dynamic configuration, allowing you to change any property at runtime. It's built upon HikariCP, Flyway and Jindy.
DrowsyDataSource is in itself a Lifecycle and can be used separately from Drowsy.

Usage

Lifecycle

DrowsyDataSource ds = new DrowsyDataSource();
ds.start();
... your code ...
ds.stop();

Retrieving a connection

Connection got = ds.getConnection();
... your code ...
got.close();

Keep in mind that DrowsyDataSource does not handle resource release. If you're using this module alone, ensure you close your Connections, Statements, ResultSets or any other JDBC resource you create.

Configuration

DataSource configuration is as in HikariCP, prefixed with jdbc. Plus two Flyway specific configurations.

jdbc.url=jdbc:postgresql://localhost:5432/MyDB
jdbc.username=me
jdbc.password=hunter2
...

# Whether or not to use Flyway, defaults to false
jdbc.flyway.bypass=false
#If set and Flyway is active, only updates greater that this will be applied, defaults to null
jdbc.flyway.baselineVersion=3

Clone this wiki locally

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.