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
Bottomline binaries download.
Older versions prior to 1.2 also require jcl.jar
Connection conn1 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?user=root&password=root"
Connection conn2 = DriverManager.getConnection("jdbc:bottomline:mysql://localhost:3306/myDB?"
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 -->
<!-- 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
Connection mySQL5Con = ((DataSource)context.lookup("java:/MySQL_Version_5")).getConnection();
Connection mySQL3Con = ((DataSource)context.lookup("java:/MySQL_Version_3")).getConnection();
svn co https://svn.sourceforge.net/svnroot/bottomline