Model Context Protocol (MCP) finally gives AI models a way to access the business data needed to make them really useful at work. CData MCP Servers have the depth and performance to make sure AI has access to all of the answers.
Try them now for free →Connect to Certinia Data in JRuby
Create a simple JRuby app with access to live Certinia data.
JRuby is a high-performance, stable, fully threaded Java implementation of the Ruby programming language. The CData JDBC Driver for Certinia makes it easy to integrate connectivity to live Certinia data in JRuby. This article shows how to create a simple JRuby app that connects to Certinia data, executes a query, and displays the results.
Configure a JDBC Connection to Certinia Data
Before creating the app, note the installation location for the JAR file for the JDBC Driver (typically C:\Program Files\CData\CData JDBC Driver for Certinia\lib).
JRuby natively supports JDBC, so you can easily connect to Certinia and execute SQL queries. Initialize the JDBC connection with the getConnection function of the java.sql.DriverManager class.
There are several authentication methods available for connecting to Certinia: login credentials, SSO, and OAuth.
Authenticating with a Login and Token
Set the User and Password to your login credentials. Additionally, set the SecurityToken. By default, the SecurityToken is required, but you can make it optional by allowing a range of trusted IP addresses.
To disable the security token:
- Log in to Certinia and enter "Network Access" in the Quick Find box in the setup section.
- Add your IP address to the list of trusted IP addresses.
To obtain the security token:
- Open the personal information page on certinia.com.
- Click the link to reset your security token. The token will be emailed to you.
- Specify the security token in the SecurityToken connection property or append it to the Password.
Authenticating with OAuth
If you do not have access to the user name and password or do not want to require them, use the OAuth user consent flow. See the OAuth section in the Help for an authentication guide.
Connecting to Certinia Sandbox Accounts
Set UseSandbox to true (false by default) to use a Certinia sandbox account. Ensure that you specify a sandbox user name in User.
Built-in Connection String Designer
For assistance in constructing the JDBC URL, use the connection string designer built into the Certinia JDBC Driver. Either double-click the JAR file or execute the jar file from the command-line.
java -jar cdata.jdbc.certinia.jar
Fill in the connection properties and copy the connection string to the clipboard.

Below is a typical JDBC connection string for Certinia:
jdbc:certinia:User=myUser;Password=myPassword;Security Token=myToken;InitiateOAuth=GETANDREFRESH
Create a JRuby App with Connectivity to Certinia Data
Create a new Ruby file (for example: CertiniaSelect.rb) and open it in a text editor. Copy the following code into your file:
require 'java'
require 'rubygems'
require 'C:/Program Files/CData/CData JDBC Driver for Certinia 2018/lib/cdata.jdbc.certinia.jar'
url = "jdbc:certinia:User=myUser;Password=myPassword;Security Token=myToken;InitiateOAuth=GETANDREFRESH"
conn = java.sql.DriverManager.getConnection(url)
stmt = conn.createStatement
rs = stmt.executeQuery("SELECT BillingState, Name FROM Account")
while (rs.next) do
puts rs.getString(1) + ' ' + rs.getString(2)
end
With the file completed, you are ready to display your Certinia data with JRuby. To do so, simply run your file from the command line:
jruby -S CertiniaSelect.rb
Writing SQL-92 queries to Certinia allows you to quickly and easily incorporate Certinia data into your own JRuby applications. Download a free trial today!