Attempts to load the JDBC driver on the thread, current or system class loaders @param driverClassName the fully qualified class name of the driver class @throws ClassNotFoundException if the class cannot be found or loaded
(String driverClassName)
| 759 | * @throws ClassNotFoundException if the class cannot be found or loaded |
| 760 | */ |
| 761 | public static void loadDriver(String driverClassName) throws ClassNotFoundException { |
| 762 | // let's try the thread context class loader first |
| 763 | // let's try to use the system class loader |
| 764 | try { |
| 765 | Class.forName(driverClassName); |
| 766 | } |
| 767 | catch (ClassNotFoundException e) { |
| 768 | try { |
| 769 | Thread.currentThread().getContextClassLoader().loadClass(driverClassName); |
| 770 | } |
| 771 | catch (ClassNotFoundException e2) { |
| 772 | // now let's try the classloader which loaded us |
| 773 | try { |
| 774 | Sql.class.getClassLoader().loadClass(driverClassName); |
| 775 | } |
| 776 | catch (ClassNotFoundException e3) { |
| 777 | throw e; |
| 778 | } |
| 779 | } |
| 780 | } |
| 781 | } |
| 782 | |
| 783 | /** Stored procedure OUT parameter marker for JDBC type {@link Types#ARRAY ARRAY}. */ |
| 784 | public static final OutParameter ARRAY = () -> Types.ARRAY; |
no test coverage detected