Skip to content

Minecraft 1.6.1-এর জন্য SQLibrary প্লাগইন

SQLibrary-এর লক্ষ্য হলো প্রতিটি ডেটাবেস ইঞ্জিনের জন্য Java-তে ড্রাইভার র্যাপারগুলোকে সহজ করা

থেকে PatPeter · CurseForge
ভিউ
১৩ ভিউ
আপডেট করা হয়েছে
আপডেট করা হয়েছে 18.10.2026
  • 1.6.1

SQLibrary প্লাগইন সম্পর্কে

I would highly suggest using Bukkit's plugin databases API instead of this plugin.

SQLibrary

SQLibrary was taken over from alta189 by PatPeter. So far it has support for 13 databases, a factory, and one query builder.

Tutorial

First, add these elements to your pom.xml if you're using Maven:

<repository> <id>dakani</id> <name>Dakani Nexus Repo</name> <url>http://repo.dakanilabs.com/content/repositories/public</url> </repository> <dependency> <groupId>lib.PatPeter.SQLibrary</groupId> <artifactId>SQLibrary</artifactId> <version>7.1</version> </dependency>

You should always save implementations to a superclass, unless that child class has more functionality. So, start off by creating your variable:

private Database sql;

Constructing your database object can be either hardcoded into the definition, or assigned in the method. The constructor does not automatically open the database connection so that it does not have to throw an SQLException (though this was considered for quite some time). Below are the constructors for the most popular databases: MySQL, SQLite, and H2.

sql = new MySQL(Logger.getLogger("Minecraft"), "[MyPlugin] ", "localhost", 3306, "myplugin", "minecraft", "password1"); sql = new SQLite(Logger.getLogger("Minecraft"), "[MyPlugin] ", this.getDataFolder().getAbsolutePath(), "MyPlugin", ".sqlite"); sql = new H2(Logger.getLogger("Minecraft"), "[MyPlugin] ", this.getDataFolder().getAbsolutePath(), "MyPlugin", ".h2");

For SQLite and H2, the extension is optional but will default to ".db". For MySQL, the hostname and port number are optional, but will default to those values. Next, we need to open our database connection:

if (sql.open()) { // ... }

If you know that your plugin will only use the database intermittently, you should check to see if it is open first:

if (!sql.isOpen()) { sql.open(); }

If any errors occur while opening the database connection, they will print to console.

Supported Databases

  • Firebird
  • FrontBase
  • DB2
  • H2
  • Informix
  • Ingres
  • MaxDB
  • MicrosoftSQL
  • MySQL
  • Mongo
  • mSQL
  • Oracle
  • Ovrimos
  • PostgreSQL
  • SQLite

Installation

  • Download the jar.
  • In Eclipse, go to Project Properties ==> Java Build Path ==> Add External Jar and add SQLibrary.jar.
  • Tell your users to install SQLibrary.jar along with your plugin

Do not install from source!

If you install SQLibrary directly into your plugin, the following bad things will occur:

  • You cannot run your plugin alongside SQLibrary.jar plugins. Bukkit will (usually) find the SQLibrary classes in your plugin first, and block the SQLibrary.jar dependency.
  • You cannot run your plugin alongside other plugins using SQLibrary directly from source. Same issue.
  • Updating will definitely cause these problems and cause you much pain.

Download SQLibrary from your plugin

You can now place this code in your plugin to download and load SQLibrary from your plugin at runtime:

http://dev.bukkit.org/bukkit-plugins/sqlibrary/pages/soft-dependency-download/

Special Thanks

  • alta189, for starting this library.
  • Belphemur, for adding the first version of our factory package.
  • omwah, for adding Maven to SQLibrary.
  • moose51789, for adding Spout support.
  • Mitsugaru, for hosting our Maven repository, finding bugs, and making fixes.
  • max9403, for supplying the code to download SQLibrary at runtime.
  • Go here to discuss SQLibrary!
  • Go here if you need help!
  • Go here to mention your plugin if you use SQLibrary with it!
  • Forum Thread

SQLibrary কীভাবে ইনস্টল করবেন

  1. A server on Paper or Spigot

    The plugin runs on the server core for Minecraft 1.6.1; players do not need to install anything.

  2. File goes into the plugins folder

    Download the file SQLibrary.jar (97 KB) and put it into the server’s plugins folder.

  3. Restart the server

    On startup the plugin creates its own settings folder in plugins.

  4. Use the “To server” button

    On Millida Hosting, the button at the top of the page uploads the file to your server and restarts it for you.

Minecraft 1.6.1 runs on Java 8: with a different Java version the game may close right after launch.

ভার্সন

ডিপেন্ডেন্সিসহ

Minecraftলোডারফাইলতারিখঅ্যাকশন
——SQLibrary 7.1 - Bukkit/Spout85.6 KB
1.6.1—SQLibrary 6.097.2 KB

রিভিউ

SQLibrary-এ প্রথম রেটিং দিন

কমেন্ট 0

মন্তব্য করতে সাইন ইন করুনসাইন ইন

একই ধরনের প্লাগইন

সব প্লাগইন

এটি সম্পর্কে আরও