将 calcite 配置类用 Spring 管理,结果启动报错:nested exception is java.sql.SQLException: No suitable driver found for jdbc:calcite:
原因是驱动没有注册
public class Driver extends UnregisteredDriver {
public static final String CONNECT_STRING_PREFIX = "jdbc:calcite:";
final Function0<CalcitePrepare> prepareFactory;
static {
new Driver().register();
}
所以手动new一下出发注册:
Driver driver = new Driver()
或者
Class.forName("org.apache.calcite.jdbc.Driver");
问题解决。