Skip to content

Commit c912fd0

Browse files
committed
jdbc-mariadb gem initial setup (using MariaDB Java Client 1.1.7)
1 parent 5e226d4 commit c912fd0

File tree

8 files changed

+579
-0
lines changed

8 files changed

+579
-0
lines changed

jdbc-mariadb/History.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
=== 1.1.7
2+
3+
* initial release using MariaDB Java Client 1.1.7

jdbc-mariadb/LICENSE.txt

Lines changed: 502 additions & 0 deletions
Large diffs are not rendered by default.

jdbc-mariadb/README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# jdbc-mariadb
2+
3+
MariaDB Client Library (for Java Applications) is used to connect applications
4+
developed in Java to MariaDB and MySQL databases using the standard JDBC API.
5+
6+
See https://mariadb.com/kb/en/about-the-mariadb-java-client/
7+
8+
## Usage
9+
10+
To make the driver accessible to JDBC and JRuby by running :
11+
12+
require 'jdbc/mariadb'
13+
Jdbc::MariaDB.load_driver
14+
15+
## Copyright
16+
17+
Copyright (c) 2014 [The JRuby Team](https://github.com/jruby).
18+
19+
The MariaDB client library is LGPL licensed.
20+
see *LICENSE.txt* and https://www.gnu.org/licenses/lgpl.html

jdbc-mariadb/Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
load File.expand_path('../Rakefile.jdbc', File.dirname(__FILE__))

jdbc-mariadb/jdbc-mariadb.gemspec

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# -*- encoding: utf-8 -*-
2+
$LOAD_PATH << File.expand_path('../lib', __FILE__)
3+
require 'jdbc/mariadb/version'
4+
5+
Gem::Specification.new do |gem|
6+
gem.name = %q{jdbc-mariadb}
7+
gem.version = Jdbc::MariaDB::VERSION
8+
9+
gem.authors = ['Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors']
10+
11+
gem.homepage = 'https://github.com/jruby/activerecord-jdbc-adapter'
12+
gem.licenses = ['LGPL']
13+
14+
gem.files = [ 'README.md', 'LICENSE.txt', *Dir['lib/**/*'].to_a ]
15+
16+
gem.rdoc_options = ["--main", "README.md"]
17+
gem.require_paths = ["lib"]
18+
19+
gem.summary = %q{JDBC driver for JRuby and MariaDB/MySQL (usable with ActiveRecord-JDBC).}
20+
gem.description = %q{Install this gem `require 'jdbc/mariadb'` and invoke `Jdbc::MariaDB.load_driver` within JRuby to load the driver.}
21+
end

jdbc-mariadb/lib/jdbc/mariadb.rb

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
warn "Jdbc-MariaDB is only for use with JRuby" if (JRUBY_VERSION.nil? rescue true)
2+
require 'jdbc/mariadb/version'
3+
4+
module Jdbc
5+
module MariaDB
6+
7+
def self.driver_jar
8+
"mariadb-java-client-#{DRIVER_VERSION}.jar"
9+
end
10+
11+
def self.load_driver(method = :load)
12+
send method, driver_jar
13+
end
14+
15+
def self.driver_name
16+
'org.mariadb.jdbc.Driver'
17+
end
18+
19+
if defined?(JRUBY_VERSION) && # enable backwards-compat behavior :
20+
( Java::JavaLang::Boolean.get_boolean("jdbc.driver.autoload") ||
21+
Java::JavaLang::Boolean.get_boolean("jdbc.mariadb.autoload") )
22+
warn "autoloading JDBC driver on require 'jdbc/mariadb'" if $VERBOSE
23+
load_driver :require
24+
end
25+
end
26+
end
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module Jdbc
2+
module MariaDB
3+
DRIVER_VERSION = '1.1.7'
4+
VERSION = DRIVER_VERSION
5+
end
6+
end
225 KB
Binary file not shown.

0 commit comments

Comments
 (0)