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
BYTEARRAY | STRING | UINT8 | INT8 | UINT16 | INT16 | UINT32 | INT32 | UINT64 | INT64 | FLOAT32 | FLOAT64 | BOOL | TIMESTAMP | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
getByte() | - | - | - | x | - | - | - | - | - | - | - | - | - | - |
getShort() | - | - | x | x | - | x | - | - | - | - | - | - | - | - |
getInt() | - | - | x | x | x | x | - | x | - | - | - | - | - | - |
getLong() | - | - | x | x | x | x | x | x | - | x | - | - | - | - |
getBigDecimal() | - | - | x | x | x | x | x | x | x | x | x | x | - | - |
getFloat() | - | - | x | x | x | x | - | x | - | - | x | - | - | - |
getDouble() | - | - | x | x | x | x | x | x | - | x | x | x | - | - |
getBoolean() | - | - | - | - | - | - | - | - | - | - | - | - | x | - |
getString() | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
getBytes() | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
getDate() | - | - | - | - | - | - | - | - | - | - | - | - | - | x |
getTime() | - | - | - | - | - | - | - | - | - | - | - | - | - | x |
getTimestamp() | - | - | - | - | - | - | - | - | - | - | - | - | - | x |
getObject() | x | x | x | x | x | x | x | x | x | x | x | x | x | x |
The following JDBC methods are not supported: getDateTimeOffset(), getAsciiStream(), getBinaryStream(), getCharacterStream(), getNCharacterStream(), getNString(), getClob(), and getNClob()