# NuoDB/JRuby Interface
[](http://travis-ci.org/nuodb/jruby-jdbc-nuodb) [](https://gemnasium.com/nuodb/jruby-jdbc-nuodb) [](https://codeclimate.com/github/nuodb/jruby-jdbc-nuodb)
## DESCRIPTION
This is the official JRuby Gem for NuoDB. It is implemented as a JDBC driver.
It is a native Java driver that converts JDBC (Java Database Connectivity)
calls into the network protocol used by the NuoDB database.
## Usage
To make the driver accessible to JDBC and ActiveRecord code running in JRuby :
require 'jdbc/nuodb'
Jdbc::NuoDB.load_driver
## ENVIRONMENT SETUP
### MAC
To set up JRuby on Mac, you may optimally install RVM and use that to install
JRuby, or you may also install it from the package installer available online
which requires additional environment setup.
For Mac, run the package installer available at:
http://jruby.org.s3.amazonaws.com/downloads/1.7.2/JRuby-1.7.2.dmg
Then update your path so that the Gem from JRuby is first on your path ahead
of the system installed ruby:
export PATH=/Library/Frameworks/JRuby.framework/Versions/Current/bin:$PATH
If you fail to do this you will see the following error:
cannot load such file -- java
## BUILDING THE GEM
To compile and test run this command:
jruby -S rake clean build spec
## INSTALLING THE GEM
jruby -S gem install jdbc-nuodb-1.2.gem
Or from the source tree:
jruby -S gem install pkg/jdbc-nuodb-1.2.gem
## TESTING THE GEM
Start up a minimal chorus as follows:
export NUODB_ROOT=/path/to/nuodb/install/directory
java -jar ${NUODB_ROOT}/jar/nuoagent.jar --broker &
${NUODB_ROOT}/bin/nuodb --chorus test --password bar --dba-user dba --dba-password dba --verbose debug --archive /var/tmp/nuodb --initialize --force &
${NUODB_ROOT}/bin/nuodb --chorus test --password bar --dba-user dba --dba-password dba &
Create a user in the database:
${NUODB_ROOT}/bin/nuosql test@localhost --user dba --password dba
> create user cloud password 'user';
> exit
Run the tests:
jruby -S rake spec
## PUBLISHING THE GEM
### TAGGING
Tag the product using tags per the SemVer specification; our tags have a
v-prefix:
git tag -a v1.2 -m "SemVer Version: v1.2"
If you make a mistake, take it back quickly:
git tag -d v1.2
git push origin :refs/tags/v1.2
### PUBLISHING
Here are the commands used to publish:
gem push pkg/jdbc-nuodb-1.2.gem
## INSPECTING THE GEM
It is often useful to inspect the contents of a Gem before distribution. To do
this you dump the contents of a gem thus:
gem unpack pkg/jdbc-nuodb-1.2.gem
## REFERENCES
[![githalytics.com alpha](https://cruel-carlota.pagodabox.com/37e0a6f0f6a114235cd8699a9d861e56 "githalytics.com")](http://githalytics.com/nuodb/jruby-jdbc-nuodb)