Feature: JDBC 4.1 enhancements.
Extend javax.sql.DataSource by method
public Logger getParentLogger() throws
SQLFeatureNotSupportedException
Bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=383156
Change-Id: I7d3deddb6bfa047752678992a17f4ba363290d04
Signed-off-by: Juergen G. Kissner <juergen.kissner@sap.com>
diff --git a/derby/org.apache.derby/.classpath b/derby/org.apache.derby/.classpath
index 1284234..09fc6f1 100644
--- a/derby/org.apache.derby/.classpath
+++ b/derby/org.apache.derby/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry exported="true" kind="lib" path="derby.jar"/>
<classpathentry exported="true" kind="lib" path="derbyclient.jar"/>
diff --git a/derby/org.apache.derby/.settings/org.eclipse.jdt.core.prefs b/derby/org.apache.derby/.settings/org.eclipse.jdt.core.prefs
index c86df58..f287d53 100644
--- a/derby/org.apache.derby/.settings/org.eclipse.jdt.core.prefs
+++ b/derby/org.apache.derby/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,7 @@
-#Fri May 28 16:04:10 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/derby/org.apache.derby/META-INF/MANIFEST.MF b/derby/org.apache.derby/META-INF/MANIFEST.MF
index 257aa33..3f8bda8 100644
--- a/derby/org.apache.derby/META-INF/MANIFEST.MF
+++ b/derby/org.apache.derby/META-INF/MANIFEST.MF
@@ -9,7 +9,7 @@
javax.transaction,javax.transaction.xa,
org.osgi.framework;version="1.3.0"
DynamicImport-Package: *
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ClassPath: .,
derby.jar,
derbyclient.jar
diff --git a/derby/org.eclipse.gemini.dbaccess.derby/.classpath b/derby/org.eclipse.gemini.dbaccess.derby/.classpath
index 335ba65..c51c113 100644
--- a/derby/org.eclipse.gemini.dbaccess.derby/.classpath
+++ b/derby/org.eclipse.gemini.dbaccess.derby/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/derby/org.eclipse.gemini.dbaccess.derby/.settings/org.eclipse.jdt.core.prefs b/derby/org.eclipse.gemini.dbaccess.derby/.settings/org.eclipse.jdt.core.prefs
index 44217f8..f287d53 100644
--- a/derby/org.eclipse.gemini.dbaccess.derby/.settings/org.eclipse.jdt.core.prefs
+++ b/derby/org.eclipse.gemini.dbaccess.derby/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +1,7 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/derby/org.eclipse.gemini.dbaccess.derby/META-INF/MANIFEST.MF b/derby/org.eclipse.gemini.dbaccess.derby/META-INF/MANIFEST.MF
index 0b08acd..cbe7d01 100644
--- a/derby/org.eclipse.gemini.dbaccess.derby/META-INF/MANIFEST.MF
+++ b/derby/org.eclipse.gemini.dbaccess.derby/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@
Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.gemini.dbaccess.derby.Activator
Bundle-Vendor: Eclipse Gemini
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: javax.sql,
org.apache.derby.client.am,
org.apache.derby.jdbc,
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
diff --git a/mysql/com.mysql.jdbc/.settings/org.eclipse.jdt.core.prefs b/mysql/com.mysql.jdbc/.settings/org.eclipse.jdt.core.prefs
index 9b423b4..f287d53 100644
--- a/mysql/com.mysql.jdbc/.settings/org.eclipse.jdt.core.prefs
+++ b/mysql/com.mysql.jdbc/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Sun Oct 23 22:54:43 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
diff --git a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/Driver.java b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/Driver.java
index 484a718..3750391 100644
--- a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/Driver.java
+++ b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/Driver.java
@@ -3,7 +3,9 @@
import java.sql.Connection;
import java.sql.DriverPropertyInfo;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
import java.util.Properties;
+import java.util.logging.Logger;
public class Driver implements java.sql.Driver {
@@ -44,4 +46,9 @@
return false;
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
index ae5d529..b3a9393 100644
--- a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
+++ b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlConnectionPoolDataSource.java
@@ -2,6 +2,8 @@
import java.io.PrintWriter;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
import javax.sql.ConnectionPoolDataSource;
import javax.sql.PooledConnection;
@@ -45,4 +47,9 @@
return null;
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
index 47582a3..33079f3 100644
--- a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
+++ b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
@@ -3,6 +3,8 @@
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
import javax.sql.DataSource;
@@ -57,4 +59,9 @@
return null;
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.java b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.java
index abcbe4e..f92d81c 100644
--- a/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.java
+++ b/mysql/com.mysql.jdbc/src/com/mysql/jdbc/jdbc2/optional/MysqlXADataSource.java
@@ -2,6 +2,8 @@
import java.io.PrintWriter;
import java.sql.SQLException;
+import java.sql.SQLFeatureNotSupportedException;
+import java.util.logging.Logger;
import javax.sql.XAConnection;
import javax.sql.XADataSource;
@@ -45,4 +47,9 @@
return null;
}
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
}
diff --git a/org.eclipse.gemini.dbaccess.util/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.gemini.dbaccess.util/.settings/org.eclipse.jdt.core.prefs
index ec9e8a7..f287d53 100644
--- a/org.eclipse.gemini.dbaccess.util/.settings/org.eclipse.jdt.core.prefs
+++ b/org.eclipse.gemini.dbaccess.util/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Wed Oct 19 21:10:28 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
diff --git a/org.eclipse.gemini.dbaccess.util/src/org/eclipse/gemini/dbaccess/UrlBasedDriverDataSource.java b/org.eclipse.gemini.dbaccess.util/src/org/eclipse/gemini/dbaccess/UrlBasedDriverDataSource.java
index 611f00e..c8cdbe9 100644
--- a/org.eclipse.gemini.dbaccess.util/src/org/eclipse/gemini/dbaccess/UrlBasedDriverDataSource.java
+++ b/org.eclipse.gemini.dbaccess.util/src/org/eclipse/gemini/dbaccess/UrlBasedDriverDataSource.java
@@ -17,10 +17,12 @@
import java.io.PrintWriter;
import java.util.Properties;
+import java.util.logging.Logger;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Driver;
+import java.sql.SQLFeatureNotSupportedException;
import static org.osgi.service.jdbc.DataSourceFactory.*;
@@ -82,4 +84,9 @@
public void setLoginTimeout(int timeout) throws SQLException {
throw new SQLException("Can't set Login Timeout on URL data source");
}
+
+
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {
+ return this.driver.getParentLogger();
+ }
}
\ No newline at end of file
diff --git a/samples/org.eclipse.gemini.dbaccess.samples/.classpath b/samples/org.eclipse.gemini.dbaccess.samples/.classpath
index 335ba65..c51c113 100644
--- a/samples/org.eclipse.gemini.dbaccess.samples/.classpath
+++ b/samples/org.eclipse.gemini.dbaccess.samples/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/samples/org.eclipse.gemini.dbaccess.samples/.settings/org.eclipse.jdt.core.prefs b/samples/org.eclipse.gemini.dbaccess.samples/.settings/org.eclipse.jdt.core.prefs
index 25aa1a6..f287d53 100644
--- a/samples/org.eclipse.gemini.dbaccess.samples/.settings/org.eclipse.jdt.core.prefs
+++ b/samples/org.eclipse.gemini.dbaccess.samples/.settings/org.eclipse.jdt.core.prefs
@@ -1,8 +1,7 @@
-#Fri May 28 16:33:44 EDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/samples/org.eclipse.gemini.dbaccess.samples/META-INF/MANIFEST.MF b/samples/org.eclipse.gemini.dbaccess.samples/META-INF/MANIFEST.MF
index cfaaa8e..16b649c 100644
--- a/samples/org.eclipse.gemini.dbaccess.samples/META-INF/MANIFEST.MF
+++ b/samples/org.eclipse.gemini.dbaccess.samples/META-INF/MANIFEST.MF
@@ -9,6 +9,6 @@
org.osgi.framework;version="1.3.0",
org.osgi.service.jdbc;version="1.0.0",
org.osgi.util.tracker;version="1.4"
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6