Git Product home page Git Product logo

dbshare's Introduction

DbShare

DbShare is a helper plugin which allows you to build your HikariDataSources once and reuse them across plugins.

Step One: Edit the configuration file (config.yml)

###############################################################################
# DbShare Configuration File
###############################################################################

# List of data source that plugins can access.
Databases:
  # Name of the data source
  MainDbShare:
    # Username for connecting to the database.
    Username: mc
    # Password for connecting to the database.
    Password: dbshare
    # This should have three parts: the main URL, the port number, and database name.
    URL: localhost:3306/minecraft

Step Two: Use it in your plugin

public void updateDatabase() {
  HikariDataSource dataSource = DbShare.instance().getDataSource("MainDbShare");
  
  try(Connection connection = dataSource.getConnection()) {
    // Use the connection
  };
}

Licence (GPLv3)

DbShare - Multiple HikariDataSource manager for Spigot
Copyright (C) 2017 Trace Bachi ([email protected])

DbShare 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.

DbShare 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 DbShare.  If not, see <http://www.gnu.org/licenses/>.

dbshare's People

Contributors

geeitszee avatar

Stargazers

 avatar Connor avatar

Watchers

James Cloos avatar  avatar

Forkers

mythicmc

dbshare's Issues

Exception during pool initialization.

Hello, I can't use this plugin nor other plugins from Delta, everytime I restart the server I get this error:
https://hastebin.com/pumedevede.md
I have DeltaRedis installed on my server and I have a Redis installed too.

Spigot version: 1.10.2 R0.1-SNAPSHOT

Java version:
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

BungeeCord version:
BungeeCord-Bootstrap:1.12-SNAPSHOT:6958943:1244 by md_5

OS
Debian 8

Thank you for your time.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.