diff --git a/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/DataSourceFactoryConstants.java b/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/DataSourceFactoryConstants.java deleted file mode 100644 index f9d6849..0000000 --- a/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/DataSourceFactoryConstants.java +++ /dev/null
@@ -1,33 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at - * http://www.opensource.org/licenses/apache2.0.php. - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * mkeith - Constants for Derby JDBC support - ******************************************************************************/ - -package org.eclipse.gemini.dbaccess.derby; - -/** - * Contants for Derby data source factory registration. - */ -public class DataSourceFactoryConstants { - - // Register a service under each of the following driver class names - public static final String DERBY_EMBEDDED_DRIVER_CLASS = "org.apache.derby.jdbc.EmbeddedDriver"; - public static final String DERBY_CLIENT_DRIVER_CLASS = "org.apache.derby.jdbc.ClientDriver"; - - // Register all Derby factory services under this driver name - public static final String DERBY_DRIVER_NAME = "Derby"; - - // Register under the JDBC version the driver supports - public static final String JDBC_3_DRIVER_VERSION = "3.0"; - public static final String JDBC_4_DRIVER_VERSION = "4.0"; -}
diff --git a/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/UrlBasedDriverDataSource.java b/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/UrlBasedDriverDataSource.java deleted file mode 100644 index c951290..0000000 --- a/derby/org.eclipse.gemini.dbaccess.derby/src/org/eclipse/gemini/dbaccess/derby/UrlBasedDriverDataSource.java +++ /dev/null
@@ -1,96 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2010 Oracle. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * and Apache License v2.0 which accompanies this distribution. - * The Eclipse Public License is available at - * http://www.eclipse.org/legal/epl-v10.html - * and the Apache License v2.0 is available at - * http://www.opensource.org/licenses/apache2.0.php. - * You may elect to redistribute this code under either of these licenses. - * - * Contributors: - * mkeith - CLient/Server Derby JDBC support - ******************************************************************************/ - -package org.eclipse.gemini.dbaccess.derby; - -import java.io.PrintWriter; -import java.util.Properties; -import java.sql.Connection; -import java.sql.DriverManager; -import java.sql.SQLException; -import java.sql.Driver; - -import org.apache.derby.jdbc.ClientDriver; -import org.apache.derby.jdbc.EmbeddedDriver; - -import static org.osgi.service.jdbc.DataSourceFactory.*; - -/** - * An abbreviated/simplified DataSource impl that takes a URL from the client - * and just returns a thin data source wrapper around the basic JDBC driver. - */ -class UrlBasedDriverDataSource implements javax.sql.DataSource { - - boolean embedded; - Driver driver; - Properties properties = null; - String url = null; - - /** - * @param properties The properties to use for operations on the driver - * @param embedded Whether to wrap an embedded or a client driver - */ - public UrlBasedDriverDataSource(Properties properties, boolean embedded) { - this.embedded = embedded; - this.driver = embedded ? new EmbeddedDriver() : new ClientDriver(); - this.properties = (Properties) properties.clone(); - this.url = properties.getProperty(JDBC_URL); - } - - public UrlBasedDriverDataSource(Properties properties) { - this(properties, true); - } - - public Connection getConnection() throws java.sql.SQLException { - return driver.connect(url, properties); - } - - public Connection getConnection(String user, String password) throws java.sql.SQLException { - Properties localProps = (Properties) properties.clone(); - localProps.put(JDBC_USER, user); - localProps.put(JDBC_PASSWORD, password); - return driver.connect(url, localProps); - } - - public boolean isWrapperFor(Class<?> cls) { - return embedded - ? (cls == EmbeddedDriver.class) - : (cls == ClientDriver.class); - } - - public <T> T unwrap(Class<T> cls) { - return (isWrapperFor(cls)) - ? (T) driver - : null; - } - - public PrintWriter getLogWriter() throws SQLException { - return DriverManager.getLogWriter(); - } - - public int getLoginTimeout() throws SQLException { - return DriverManager.getLoginTimeout(); - } - - // Don't support setting log writer or timeout - - public void setLogWriter(PrintWriter writer) throws SQLException { - throw new SQLException("Can't set Log Writer on URL data source"); - } - - public void setLoginTimeout(int timeout) throws SQLException { - throw new SQLException("Can't set Login Timeout on URL data source"); - } -} \ No newline at end of file