问题描述
我做了个插件,需要运行时加载jdbc包,同时还使用了apache的数据源代码如下URLpath=newURL("file:///C:/MyJar/sqljdbc.jar");URLClassLoadercl=URLClassLoader.newInstance(newURL[]{path},Thread.currentThread().getContextClassLoader());Thread.currentThread().setContextClassLoader(cl);结果读取数据库还是失败,因为数据源中通过class.formName("xxxxx");还是获取失败。不知有啥好方法。
时间: 2024-09-02 09:44:27