org.protege.osgi.jdbc.impl.Activator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontop-protege Show documentation
Show all versions of ontop-protege Show documentation
Ontop OBDA plugin for protégé
package org.protege.osgi.jdbc.impl;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
import org.protege.osgi.jdbc.JdbcRegistry;
import org.protege.osgi.jdbc.OSGiJdbcDriver;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Hashtable;
public class Activator implements BundleActivator {
private OSGiJdbcDriver driver;
@Override
public void start(BundleContext context) throws SQLException {
try {
JdbcRegistry registry = new JdbcRegistryImpl();
context.registerService(JdbcRegistry.class.getName(), registry, new Hashtable());
driver = new OSGiJdbcDriver(context, registry);
DriverManager.registerDriver(driver);
}
catch (Throwable t) {
t.printStackTrace();
}
}
@Override
public void stop(BundleContext context) throws Exception {
DriverManager.deregisterDriver(driver);
driver = null;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy