Skip to main content

Overview

In our continued commitment to interoperability, Blockpoint provides a Java Database Connectivity (JDBC) driver for use with MDB. The driver is available at no extra charge and provides Java database connectivity from any Java application, application server, or Java-enabled applet. This driver is a Type 4 JDBC driver that provides database connectivity through the standard JDBC application program interfaces (APIs).

Download

The JDBC driver is to be used with Maven. To find the latest version of the JDBC, use the maven central repository.

Add the following Maven dependency to your pom.xml file:

<dependency>
<groupId>com.blockpointdb</groupId>
<artifactId>mdb-jdbc</artifactId>
<version>x.x.x</version>
</dependency>

This imports the .jar files to be used for execution.

Connecting

While there are many ways to connect to the mdb:jdbc driver, it is common to use the following methods: java.sql.DriverManager.getConnection(String url) and java.sql.DriverManager.getConnection(String url, Properties p)

import java.sql.*;
import java.util.Properties;

public class Utilities {

public void connectExamples() throws SQLException {
String baseURL = "jdbc:mdb://0.0.0.0:8080/master";

// As a service full URL.
c = DriverManager.getConnection(baseURL + "?user=username&password=password");
c.close();

Properties p = new Properties();
p.setProperty("user", "username");
p.setProperty("password", "password");

// As a service base URL and properties.
c = DriverManager.getConnection(baseURL, p);
c.close();
}
}

Getter Method Conversions

To facilitate the conversion of Java programming language data types to bSQL data types, the MDB JDBC Driver for bSQL provides data type conversions as required by the JDBC specification. For added flexibility, all types are convertible to Object, String, and byte[] data types.

Key:

  • Not supported: -
  • Non-lossy: x
  • Bold: default
BYTEARRAYSTRINGUINT8INT8UINT16INT16UINT32INT32UINT64INT64FLOAT32FLOAT64BOOLTIMESTAMP
getByte()---x----------
getShort()--xx-x--------
getInt()--xxxx-x------
getLong()--xxxxxx-x----
getBigDecimal()--xxxxxxxxxx--
getFloat()--xxxx-x--x---
getDouble()--xxxxxx-xxx--
getBoolean()------------x-
getString()xxxxxxxxxxxxxx
getBytes()xxxxxxxxxxxxxx
getDate()-------------x
getTime()-------------x
getTimestamp()-------------x
getObject()xxxxxxxxxxxxxx

The following JDBC methods are not supported: getDateTimeOffset(), getAsciiStream(), getBinaryStream(), getCharacterStream(), getNCharacterStream(), getNString(), getClob(), and getNClob()