--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.jdbc.Driver30\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to You under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.jdbc;\r
+\r
+import org.apache.derby.impl.jdbc.EmbedConnection;\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;\r
+import org.apache.derby.iapi.error.StandardException;\r
+import org.apache.derby.iapi.jdbc.BrokeredConnection;\r
+import org.apache.derby.iapi.jdbc.BrokeredConnection30;\r
+import org.apache.derby.iapi.jdbc.BrokeredConnectionControl;\r
+import org.apache.derby.iapi.jdbc.ResourceAdapter;\r
+\r
+import java.sql.Connection;\r
+import java.sql.SQLException;\r
+import java.sql.SQLFeatureNotSupportedException;\r
+\r
+import org.apache.derby.impl.jdbc.*;\r
+\r
+/** -- jdbc 2.0. extension -- */\r
+import javax.sql.PooledConnection;\r
+import javax.sql.XAConnection;\r
+\r
+import java.util.Properties;\r
+import java.util.logging.Logger;\r
+\r
+/**\r
+ This class extends the local20 JDBC driver in order to determine at JBMS\r
+ boot-up if the JVM that runs us does support JDBC 3.0. If it is the case\r
+ then we will load the appropriate class(es) that have JDBC 3.0 new public\r
+ methods and sql types.\r
+ \r
+*/\r
+\r
+public class Driver30 extends Driver20 {\r
+\r
+ /**\r
+ * Get a new nested connection.\r
+ *\r
+ * @param conn The EmbedConnection.\r
+ *\r
+ * @return A nested connection object.\r
+ *\r
+ */\r
+ public Connection getNewNestedConnection(EmbedConnection conn)\r
+ {\r
+ if (SanityManager.DEBUG)\r
+ {\r
+ SanityManager.ASSERT(conn instanceof EmbedConnection30,\r
+ "conn expected to be instanceof EmbedConnection30");\r
+ }\r
+ return new EmbedConnection30(conn);\r
+ }\r
+\r
+ /*\r
+ Methods to be overloaded in sub-implementations such as\r
+ a tracing driver.\r
+ */\r
+ public EmbedConnection getNewEmbedConnection(String url, Properties info)\r
+ throws SQLException \r
+ {\r
+ return new EmbedConnection30(this, url, info);\r
+ }\r
+\r
+ /**\r
+ @exception SQLException if fails to create statement\r
+ */\r
+ public java.sql.PreparedStatement\r
+ newEmbedPreparedStatement (\r
+ EmbedConnection conn,\r
+ String stmt,\r
+ boolean forMetaData,\r
+ int resultSetType,\r
+ int resultSetConcurrency,\r
+ int resultSetHoldability,\r
+ int autoGeneratedKeys,\r
+ int[] columnIndexes,\r
+ String[] columnNames)\r
+ throws SQLException\r
+ {\r
+ return new EmbedPreparedStatement30(conn,\r
+ stmt,\r
+ forMetaData,\r
+ resultSetType,\r
+ resultSetConcurrency,\r
+ resultSetHoldability,\r
+ autoGeneratedKeys,\r
+ columnIndexes,\r
+ columnNames);\r
+ }\r
+\r
+ /**\r
+ @exception SQLException if fails to create statement\r
+ */\r
+ public java.sql.CallableStatement\r
+ newEmbedCallableStatement(\r
+ EmbedConnection conn,\r
+ String stmt,\r
+ int resultSetType,\r
+ int resultSetConcurrency,\r
+ int resultSetHoldability)\r
+ throws SQLException\r
+ {\r
+ return new EmbedCallableStatement30(conn,\r
+ stmt,\r
+ resultSetType,\r
+ resultSetConcurrency,\r
+ resultSetHoldability);\r
+ }\r
+ public BrokeredConnection newBrokeredConnection(BrokeredConnectionControl control) {\r
+\r
+ return new BrokeredConnection30(control);\r
+ }\r
+\r
+ /**\r
+ * Create and return an EmbedPooledConnection from the received instance\r
+ * of EmbeddedDataSource.\r
+ */\r
+ protected PooledConnection getNewPooledConnection(\r
+ EmbeddedDataSource eds, String user, String password,\r
+ boolean requestPassword) throws SQLException\r
+ {\r
+ return new EmbedPooledConnection(\r
+ eds, user, password, requestPassword);\r
+ }\r
+\r
+ /**\r
+ * Create and return an EmbedXAConnection from the received instance\r
+ * of EmbeddedDataSource.\r
+ */\r
+ protected XAConnection getNewXAConnection(\r
+ EmbeddedDataSource eds, ResourceAdapter ra,\r
+ String user, String password, boolean requestPassword)\r
+ throws SQLException\r
+ {\r
+ return new EmbedXAConnection(\r
+ eds, ra, user, password, requestPassword);\r
+ }\r
+\r
+ public Logger getParentLogger() throws SQLFeatureNotSupportedException {\r
+ // TODO Auto-generated method stub\r
+ return null;\r
+ }\r
+\r
+}\r