Skip to content

Commit

Permalink
[fix](connector) fix no suitable driver found issue when getting fe j…
Browse files Browse the repository at this point in the history
…dbc connection (#251)
  • Loading branch information
gnehil authored Jan 6, 2025
1 parent c0b1bc2 commit 00759cb
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ public <T> T queryFrontends(Function<Connection, T> function) throws Exception {
ex = new OptionRequiredException(DorisOptions.DORIS_QUERY_PORT.getName());
break;
}
try {
Class.forName("com.mysql.cj.jdbc.Driver");
} catch (ClassNotFoundException e) {
Class.forName("com.mysql.jdbc.Driver");
}
try (Connection conn = DriverManager.getConnection("jdbc:mysql://" + frontEnd.getHost() + ":" + frontEnd.getQueryPort(), username, password)) {
return function.apply(conn);
} catch (SQLException e) {
Expand Down

0 comments on commit 00759cb

Please sign in to comment.