public static IPersistible doLoad(PersistenceUri uri) throws DDFException { if (uri == null) throw new DDFException("URI cannot be null"); if (Strings.isNullOrEmpty(uri.getEngine())) throw new DDFException("Engine/Protocol in URI cannot be missing"); return DDFManager.get(EngineType.fromString(uri.getEngine())).load(uri); }
@Test public void testLoadFromJDBC() throws DDFException, URISyntaxException { // load data from a MySQL JDBCDataSourceDescriptor desc = new JDBCDataSourceDescriptor("jdbc:mysql://localhost:3306/test", "pauser", "papwd", "mtcars"); DDF ddf = manager.load(desc); Assert.assertTrue(ddf != null); Assert.assertEquals(ddf.getNumColumns(), 11); Assert.assertEquals(ddf.getNumRows(), 32); } }