Skip to content

Add support for Intersystems IRIS jdbc driver #7607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -781,6 +781,20 @@ DBInfo.Builder doParse(String jdbcUrl, DBInfo.Builder builder) {
}
return GENERIC_URL_LIKE.doParse(url, builder);
}
},

IRIS("iris") {
@Override
DBInfo.Builder doParse(String jdbcUrl, DBInfo.Builder builder) {
String url = jdbcUrl;
int firstSlash = url.indexOf('/', "jdbc://iris:/".length());
int nextSlash = url.indexOf('/', firstSlash + 1);
if (nextSlash > firstSlash) {
// strip the options and preserve only the url like part
url = url.substring(0, nextSlash);
}
return GENERIC_URL_LIKE.doParse(url, builder);
}
};

private static final Map<String, JDBCConnectionUrlParser> typeParsers = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class DefaultConnectionInstrumentation extends AbstractConnectionInstrume
"com.sap.db.jdbc.ConnectionSapDB",
// IBM Informix
"com.informix.jdbc.IfmxConnection",
// Intersystems IRIS
"com.intersystems.jdbc.IRISConnection",
// for testing purposes
"test.TestConnection"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public final class PreparedStatementInstrumentation extends AbstractPreparedStat
"software.aws.rds.jdbc.mysql.shading.com.mysql.cj.JdbcCallableStatement",
// IBM Informix
"com.informix.jdbc.IfxPreparedStatement",
// Intersystems IRIS
"com.intersystems.jdbc.IRISPreparedStatement",
"com.intersystems.jdbc.IRISCallableStatement",
// for testing purposes
"test.TestPreparedStatement"
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ class JDBCConnectionUrlParserTest extends AgentTestRunner {

// redshift
"jdbc:redshift://redshift-cluster-1.c7arcolffyvk.us-east-2.redshift.amazonaws.com:5439/dev" | null | "redshift" | null | null | "redshift-cluster-1.c7arcolffyvk.us-east-2.redshift.amazonaws.com" | 5439 | "redshift-cluster-1" | "dev"
// Intersys IRIS
"jdbc:IRIS://dbhostname:1972/namespace" | null | "iris" | null | null | "dbhostname" | 1972 | null | "namespace"
"jdbc:IRIS://dbhostname:1972/namespace/+myjdbc.log" | null | "iris" | null | null | "dbhostname" | 1972 | null | "namespace"
"jdbc:IRIS://dbhostname:1972/namespace/::false" | null | "iris" | null | null | "dbhostname" | 1972 | null | "namespace"

expected = new DBInfo.Builder().type(type).subtype(subtype).user(user).instance(instance).db(db).host(host).port(port).build()
}
Expand Down