Bottomline is a JDBC Bridge API that loads database drivers directly from JAR archives. Bottomline uses a jdbc:bottomline bridge to load multiple drivers from their respective JAR files. Unlike JDBC, Bottomline uses custom class loaders to load drivers completely bypassing JVM's bootstrap class loader.

Some features of Bottomline

Below is a diagram that illustrates how seamlessly bottomline integrates with java applications.

Using Bottomline with raw JDBC

Using Bottomline with JDBC is very easy. Bottomline provides a custom driver (BottomlineDriver) and uses the jdbc:bottomline bridge to connect to any database that is supported by JDBC. Developers will use BottomlineDriver like any other database driver and use the bridge to connect to any required database.

First download latest versions of bottomline.jar and log4j.jar files and put them in the application's CLASSPATH. These files are included in the latest Bottomline binaries download.
Older versions prior to 1.2 also require jcl.jar


Properties props = new Properties();
props.put("user", "root");
props.put("password", "root");
props.put("class", "com.mysql.jdbc.Driver");

Connection conn = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB", props);

In version 1.2 or later.
The connection parameters can be passed as Query String to the connection URL

Connection conn1 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?user=root&password=root"
                         + "

// And also like the following

Connection conn2 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?"
                        + "
"&class=com.mysql.jdbc.Driver", "root", "root");

The example shows how easy it is to use Bottomline with JDBC.

* The connection string will always starts with jdbc:bottomline prefix.

Using Bottomline with JNDI Datasources on JBoss

It is also simple to use Bottomline with JNDI Datasources. Lets take an example of JBoss. In JBoss JNDI datasources are defined in a XXX-ds.xml file in the deploy directory. Adding Bottomline datasources in this file is like adding any other datasource using any driver. JNDI bound Bottomline datasources seamlessly integrate with the application without having to change a single line of java code. Only the JNDI datasource definition file shown below needs to be updated. First download and copy latest version of bottomline.jar in "lib" directory of JBoss server e.g.  JBOSS_HOME/server/default/lib

Below is a sample spec from this file that illustrates how to bind Bottomline datasources in JNDI.


     <!-- Bottomline Connection properties -->
     <connection-property name="user">
     <connection-property name="password">
    <connection-property name="jar">
    <connection-property name="class">


<!-- Passing Bottomline connection properties as query string parameters to the connection URL -->

The example shows how two different versions of MySQL driver are loaded and bound in JNDI using the JDBC-Bottomline bridge; this is only possible through Bottomline. The connection properties are defined just like in the previous JDBC example. The connections can be looked up from InitialContext like:

Context context = new InitialContext();
Connection mySQL5Con = ((DataSource)context.lookup("java:/MySQL_Version_5")).getConnection();
Connection mySQL3Con = ((DataSource)context.lookup("java:/MySQL_Version_3")).getConnection();


Bottomline is open source and is distributed under ASL 2.0.

- Bottomline binaries

Bottomline source can be anonymously checked-out from Subversion using the following command:

svn co https://svn.sourceforge.net/svnroot/bottomline bottomline

Author: Kamran Zafar
[Author's Homepage]

Copyright Kamran Zafar 2010