The JDBC standard is inherently oriented towards relational databases and SQL queries. However, Polypheny extends beyond these limitations, supporting multiple data models and languages. To accommodate this, the JDBC standard has been extended in a feature known as the Multimodel Extension which goes beyond what is traditionally available through JDBC.
Supported Data Models
The Multimodel Extension of the Polypheny JDBC Driver is designed to accommodate a diverse range of data models. Specifically, it supports the Relational model the Labeled Property Graph model (LPG) and the Document model. This allows Java applications to interact with all datamodels currently supported by Polypheny using a single driver. .
Supported Languages
In the future, the intention is to support all languages that can be loaded as plugins into Polypheny.
Currently the following languages are supported. At some points when working with the multi model extension langugaes must be specified. This is done using their names. The name for each language is provided below.
Query Language | Name used for the languageName parameter |
---|---|
SQL | sql |
MongoDB Query Language | mql |
These are the query languages currently supported by the Polypheny JDBC Driver. When using the execute
method, the languageName
parameter should be one of these names to correctly interpret the provided statement.
Unwrapping for Multi-Model Support
To access the features of the Multimodel Extension, the JDBC Connection
object must be unwrapped to a PolyConnection
object, which provides Polypheny-specific features. Specifically, you can use the createPolyStatement
method to generate a statement object aligned with the Multimodel Extension.
For detailed documentation on the PolyStatement object please refer to the corresponding documentation.
Usage:
try (
Connection connection = DriverManager.getConnection("jdbc:polypheny://localhost:20590");
) {
if (connection.isWrapperFor(PolyConnection.class)) {
PolyConnection polyConnection = connection.unwrap(PolyConnection.class);
PolyStatement polyStatement = polyConnection.createPolyStatement();
// You can now use polyStatement to execute multi-model queries...
}
} catch (SQLException e) {
e.printStackTrace();
}