Modified:
trunk/connector-j/.settings/org.eclipse.jdt.core.prefs
trunk/connector-j/.settings/org.eclipse.jdt.ui.prefs
trunk/connector-j/build.xml
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java
Log:
Fixups for latest mustang/JDBC-4.0 drop from Sun.
Modified: trunk/connector-j/.settings/org.eclipse.jdt.core.prefs
===================================================================
(Binary files differ)
Modified: trunk/connector-j/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- trunk/connector-j/.settings/org.eclipse.jdt.ui.prefs 2006-09-27 00:01:06 UTC (rev
5778)
+++ trunk/connector-j/.settings/org.eclipse.jdt.ui.prefs 2006-09-27 03:16:52 UTC (rev
5779)
@@ -1,3 +1,3 @@
-#Tue Feb 07 16:51:26 CST 2006
+#Tue Sep 26 22:06:10 CDT 2006
eclipse.preferences.version=1
-internal.default.compliance=user
+internal.default.compliance=default
Modified: trunk/connector-j/build.xml
===================================================================
--- trunk/connector-j/build.xml 2006-09-27 00:01:06 UTC (rev 5778)
+++ trunk/connector-j/build.xml 2006-09-27 03:16:52 UTC (rev 5779)
@@ -146,13 +146,9 @@
<target name="full-package-no-sources" description="Builds driver, binary .jar file,
docs and packages (.zip, .tar.gz) suitable for distribution that do _not_ contain
sources"
depends="full-dist, -make-packages, -remove-sources, -create-archives"/>
- <!-- disable trace until we can figure out how to get aspectj to play nice with
JDK6
+
<target name="full-dist" description="Builds driver, binary .jar file and docs,
basically a distribution 'image'"
depends="-dist-trace, dist, -bundle-docs"/>
- -->
-
- <target name="full-dist" description="Builds driver, binary .jar file and docs,
basically a distribution 'image'"
- depends="dist, -bundle-docs"/>
<target name="package" depends="dist, -make-packages, -create-archives"/>
Modified: trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java
===================================================================
--- trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java 2006-09-27
00:01:06 UTC (rev 5778)
+++ trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlDataSource.java 2006-09-27
03:16:52 UTC (rev 5779)
@@ -26,11 +26,16 @@
import com.mysql.jdbc.ConnectionProperties;
import com.mysql.jdbc.NonRegisteringDriver;
+import com.mysql.jdbc.exceptions.JDBC40NotYetImplementedException;
import java.io.PrintWriter;
import java.io.Serializable;
+import java.sql.BaseQuery;
+import java.sql.QueryObjectFactory;
+import java.sql.QueryObjectGenerator;
import java.sql.SQLException;
+import java.sql.Wrapper;
import java.util.Properties;
@@ -47,7 +52,7 @@
* @author Mark Matthews
*/
public class MysqlDataSource extends ConnectionProperties implements
- DataSource, Referenceable, Serializable {
+ DataSource, Referenceable, Serializable, Wrapper {
/** The driver to create connections with */
protected static com.mysql.jdbc.Driver mysqlDriver = null;
@@ -386,7 +391,63 @@
public String getUser() {
return this.user;
}
+
+ /**
+ * Retrieves the QueryObjectGenerator for the given JDBC driver. If the
+ * JDBC driver does not provide its own QueryObjectGenerator, NULL is
+ * returned.
+ * @return The QueryObjectGenerator for this JDBC Driver or NULL if the driver does
not provide its own
+ * implementation
+ * @exception SQLException if a database access error occurs
+ * @since 1.6
+ */
+ public QueryObjectGenerator getQueryObjectGenerator() throws SQLException {
+ return null;
+ }
+
+ /**
+ * Creates a concrete implementation of a Query interface using the JDBC drivers
<code>QueryObjectGenerator</code>
+ * implementation.
+ * <p>
+ * If the JDBC driver does not provide its own
<code>QueryObjectGenerator</code>, the
<code>QueryObjectGenerator</code>
+ * provided with Java SE will be used.
+ *<p>
+ * @param ifc The Query interface that will be created
+ * @return A concrete implementation of a Query interface
+ * @exception SQLException if a database access error occurs.
+ * @since 1.6
+ */
+ public <T extends BaseQuery> T createQueryObject(Class<T> ifc) throws
SQLException {
+ // TODO: Implementation for PooledConnections?
+ return QueryObjectFactory.createDefaultQueryObject(ifc, getConnection());
+ }
+
+ /**
+ * Creates a concrete implementation of a Query interface using the JDBC drivers
<code>QueryObjectGenerator</code>
+ * implementation.
+ * <p>*
+ * If the JDBC driver does not provide its own
<code>QueryObjectGenerator</code>, the
<code>QueryObjectGenerator</code>
+ * provided with Java SE will be used.
+ *<p>
+ * This method is primarly for developers of Wrappers to JDBC implementations.
+ * Application developers should use
<code>createQueryObject(Class<T> ifc).
+ *<p>
+ * @param ifc The Query interface that will be created
+ * @param ds The <code>DataSource</code> that will be used when invoking
methods that access
+ * the data source. The QueryObjectGenerator implementation will use
+ * this <code>DataSource</code> without any unwrapping or modications
+ * to create connections to the data source.
+ *
+ * @return An concrete implementation of a Query interface
+ * @exception SQLException if a database access error occurs.
+ * @since 1.6
+ */
+ public <T extends BaseQuery> T createQueryObject(Class<T> ifc, DataSource
ds) throws SQLException {
+ return QueryObjectFactory.createDefaultQueryObject(ifc, ds);
+ }
+
+
/**
* Creates a connection using the specified properties.
*
@@ -424,4 +485,12 @@
return mysqlDriver.connect(jdbcUrlToUse, props);
}
+
+ public boolean isWrapperFor(Class<?> iface) throws SQLException {
+ throw new JDBC40NotYetImplementedException();
+ }
+
+ public <T> T unwrap(Class<T> iface) throws SQLException {
+ throw new JDBC40NotYetImplementedException();
+ }
}
Modified: trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java
===================================================================
---
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java 2006-09-27
00:01:06 UTC (rev 5778)
+++
trunk/connector-j/src/com/mysql/jdbc/jdbc2/optional/MysqlPooledConnection.java 2006-09-27
03:16:52 UTC (rev 5779)
@@ -33,8 +33,10 @@
import javax.sql.ConnectionEvent;
import javax.sql.ConnectionEventListener;
import javax.sql.PooledConnection;
+import javax.sql.StatementEventListener;
import com.mysql.jdbc.SQLError;
+import com.mysql.jdbc.exceptions.JDBC40NotYetImplementedException;
/**
* This class is used to wrap and return a physical connection within a logical
@@ -209,4 +211,36 @@
}
}
}
+
+ /**
+ * Registers a <code>StatementEventListener</code> with this
<code>PooledConnection</code> object. Components that
+ * wish to be notified when <code>PreparedStatement</code>s created by the
+ * connection are closed or are detected to be invalid may use this method
+ * to register a <code>StatementEventListener</code> with this
<code>PooledConnection</code> object.
+ * <p>
+ * @param listener an component which implements the
<code>StatementEventListener</code>
+ * interface that is to be registered with this
<code>PooledConnection</code> object
+ * <p>
+ * @since 1.6
+ */
+ public void addStatementEventListener(StatementEventListener listener) {
+ throw new JDBC40NotYetImplementedException();
+ }
+
+ /**
+ * Removes the specified <code>StatementEventListener</code> from the list
of
+ * components that will be notified when the driver detects that a
+ * <code>PreparedStatement</code> has been closed or is invalid.
+ * <p>
+ * @param listener the component which implements the
+ * <code>StatementEventListener</code> interface that was previously
+ * registered with this <code>PooledConnection</code> object
+ * <p>
+ * @since 1.6
+ */
+ public void removeStatementEventListener(StatementEventListener listener) {
+ throw new JDBC40NotYetImplementedException();
+ }
+
+
}
\ No newline at end of file
| Thread |
|---|
| • Connector/J commit: r5779 - in trunk/connector-j: . .settings src/com/mysql/jdbc/jdbc2/optional | mmatthews | 27 Sep |