Skip to content

Commit

Permalink
jdbc-mariadb gem initial setup (using MariaDB Java Client 1.1.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
kares committed Jun 18, 2014
1 parent 5e226d4 commit c912fd0
Show file tree
Hide file tree
Showing 8 changed files with 579 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jdbc-mariadb/History.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
=== 1.1.7

* initial release using MariaDB Java Client 1.1.7
502 changes: 502 additions & 0 deletions jdbc-mariadb/LICENSE.txt

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions jdbc-mariadb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# jdbc-mariadb

MariaDB Client Library (for Java Applications) is used to connect applications
developed in Java to MariaDB and MySQL databases using the standard JDBC API.

See https://mariadb.com/kb/en/about-the-mariadb-java-client/

## Usage

To make the driver accessible to JDBC and JRuby by running :

require 'jdbc/mariadb'
Jdbc::MariaDB.load_driver

## Copyright

Copyright (c) 2014 [The JRuby Team](https://github.com/jruby).

The MariaDB client library is LGPL licensed.
see *LICENSE.txt* and https://www.gnu.org/licenses/lgpl.html
1 change: 1 addition & 0 deletions jdbc-mariadb/Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
load File.expand_path('../Rakefile.jdbc', File.dirname(__FILE__))
21 changes: 21 additions & 0 deletions jdbc-mariadb/jdbc-mariadb.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# -*- encoding: utf-8 -*-
$LOAD_PATH << File.expand_path('../lib', __FILE__)
require 'jdbc/mariadb/version'

Gem::Specification.new do |gem|
gem.name = %q{jdbc-mariadb}
gem.version = Jdbc::MariaDB::VERSION

gem.authors = ['Nick Sieger, Ola Bini, Karol Bucek and JRuby contributors']
gem.email = ['nick@nicksieger.com', 'ola.bini@gmail.com', 'self@kares.org']
gem.homepage = 'https://github.com/jruby/activerecord-jdbc-adapter'
gem.licenses = ['LGPL']

gem.files = [ 'README.md', 'LICENSE.txt', *Dir['lib/**/*'].to_a ]

gem.rdoc_options = ["--main", "README.md"]
gem.require_paths = ["lib"]

gem.summary = %q{JDBC driver for JRuby and MariaDB/MySQL (usable with ActiveRecord-JDBC).}
gem.description = %q{Install this gem `require 'jdbc/mariadb'` and invoke `Jdbc::MariaDB.load_driver` within JRuby to load the driver.}
end
26 changes: 26 additions & 0 deletions jdbc-mariadb/lib/jdbc/mariadb.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
warn "Jdbc-MariaDB is only for use with JRuby" if (JRUBY_VERSION.nil? rescue true)
require 'jdbc/mariadb/version'

module Jdbc
module MariaDB

def self.driver_jar
"mariadb-java-client-#{DRIVER_VERSION}.jar"
end

def self.load_driver(method = :load)
send method, driver_jar
end

def self.driver_name
'org.mariadb.jdbc.Driver'
end

if defined?(JRUBY_VERSION) && # enable backwards-compat behavior :
( Java::JavaLang::Boolean.get_boolean("jdbc.driver.autoload") ||
Java::JavaLang::Boolean.get_boolean("jdbc.mariadb.autoload") )
warn "autoloading JDBC driver on require 'jdbc/mariadb'" if $VERBOSE
load_driver :require
end
end
end
6 changes: 6 additions & 0 deletions jdbc-mariadb/lib/jdbc/mariadb/version.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module Jdbc
module MariaDB
DRIVER_VERSION = '1.1.7'
VERSION = DRIVER_VERSION
end
end
Binary file added jdbc-mariadb/lib/mariadb-java-client-1.1.7.jar
Binary file not shown.

0 comments on commit c912fd0

Please sign in to comment.