File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\util\DbDriverActivator.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.util;
8
9 import org.osgi.framework.BundleActivator;
10 import org.osgi.framework.BundleContext;
11
12 /**
13 * The driver activator loads the H2 driver when starting the bundle.
14 * The driver is unloaded when stopping the bundle.
15 */
16 public class DbDriverActivator implements BundleActivator {
17
18 /**
19 * Start the bundle. This will load and register the database driver.
20 *
21 * @param bundleContext the bundle context
22 */
23 public void start(BundleContext bundleContext) {
24 org.h2.Driver.load();
25 }
26
27 /**
28 * Stop the bundle. This will deregister the database driver.
29 *
30 * @param bundleContext the bundle context
31 */
32 public void stop(BundleContext bundleContext) {
33 org.h2.Driver.unload();
34 }
35
36 }
37