Loading JDBC Driver at Runtime

前端 未结 3 1240
伪装坚强ぢ
伪装坚强ぢ 2021-01-19 05:37

I\'m using the following code to load a driver class:

public class DriverLoader extends URLClassLoader {

    private DriverLoader(URL[] urls) {
        supe         


        
3条回答
  •  抹茶落季
    2021-01-19 06:01

    You should establish connection in a class loaded by your DriverLoader. So, load the connection establishment code using DriverLoader and then call JDBC from it.

提交回复
热议问题