use of org.apache.derby.jdbc.EmbeddedDriver in project camel by apache.
the class DatabaseInitializationBean method create.
public void create() throws Exception {
LOG.info("Creating database tables ...");
if (connection == null) {
EmbeddedDriver driver = new EmbeddedDriver();
connection = driver.connect(url + ";create=true", null);
}
String sql = "create table ORDERS (\n" + " ORD_ID integer primary key,\n" + " ITEM varchar(10),\n" + " ITEM_COUNT varchar(5),\n" + " ITEM_DESC varchar(30),\n" + " ORD_DELETED boolean\n" + ")";
try {
execute("drop table orders");
} catch (Throwable e) {
// ignore
}
execute(sql);
LOG.info("Database tables created");
}
use of org.apache.derby.jdbc.EmbeddedDriver in project aries by apache.
the class DerbyActivator method start.
public void start(BundleContext context) throws Exception {
new EmbeddedDriver();
context.registerService(DataSourceFactory.class.getName(), this, new Properties());
}
use of org.apache.derby.jdbc.EmbeddedDriver in project jackrabbit by apache.
the class BackwardsCompatibilityIT method testBackwardsCompatibility.
public void testBackwardsCompatibility() throws Exception {
// Force loading of the Derby JDBC driver
new EmbeddedDriver();
File target = new File("target/backwards-compatibility-test");
FileUtils.deleteDirectory(target);
target.mkdirs();
File source = new File("src/test/resources/compatibility.zip");
unpack(source, target);
for (File dir : target.listFiles()) {
if (dir.isDirectory()) {
log.info("Testing backwards compatibility with {}", dir);
checkJackrabbitRepository(dir);
NodeStore store = new SegmentNodeStore();
RepositoryUpgrade.copy(dir, store);
checkRepositoryContent(new Jcr(new Oak(store)).createRepository());
}
}
}
Aggregations