OracleJarUtils { public static Class loadClass(String className) throws Exception { try { Class cName = OracleJarUtils.class.getClassLoader().loadClass(className); return cName; } catch (Exception e) { LOG.error("Error loading a class " + className + " from ojdbc jar", e); throw e; } }  static DataSource createOracleDataSource(String uri); static Class loadClass(String className);  }
@Test public void testLoadClass() throws Exception { Class oracleDataSourceClass1 = OracleJarUtils.loadClass("oracle.jdbc.pool.OracleDataSource"); Class oracleDataSourceClass2 = OracleJarUtils.loadClass("oracle.jdbc.pool.OracleDataSource"); boolean isEqual = oracleDataSourceClass1.equals(oracleDataSourceClass2); Assert.assertEquals(isEqual, true); boolean isIdentical = (oracleDataSourceClass1 == oracleDataSourceClass2); Assert.assertEquals(isIdentical, true); }