Skip to content

Commit 106dba4

Browse files
committed
Move Derby JDBC driver into consant
1 parent 5f988fc commit 106dba4

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

  • crates/stackable-operator/src/database_connections/databases

crates/stackable-operator/src/database_connections/databases/derby.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ use crate::{
1212
utils::OptionExt as _,
1313
};
1414

15+
/// Sadly the Derby driver class name is a bit complicated, e.g. for HMS up to 4.1.x we used
16+
/// `org.apache.derby.jdbc.EmbeddedDriver`, for HMS 4.2.x we used
17+
/// `org.apache.derby.iapi.jdbc.AutoloadedDriver`.
18+
pub const DERBY_JDBC_DRIVER_CLASS: &str = "org.apache.derby.jdbc.EmbeddedDriver";
19+
1520
#[derive(Debug, Snafu)]
1621
pub enum Error {
1722
#[snafu(display("failed to parse connection URL"))]
@@ -54,10 +59,7 @@ impl JdbcDatabaseConnection for DerbyConnection {
5459
let connection_url = connection_url.parse().context(ParseConnectionUrlSnafu)?;
5560

5661
Ok(JdbcDatabaseConnectionDetails {
57-
// Sadly the Derby driver class name is a bit complicated, e.g. for HMS up to 4.1.x we used
58-
// "org.apache.derby.jdbc.EmbeddedDriver",
59-
// for HMS 4.2.x we used "org.apache.derby.iapi.jdbc.AutoloadedDriver".
60-
driver: "org.apache.derby.jdbc.EmbeddedDriver".to_owned(),
62+
driver: DERBY_JDBC_DRIVER_CLASS.to_owned(),
6163
connection_url,
6264
username_env: None,
6365
password_env: None,

0 commit comments

Comments
 (0)