All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.springframework.jdbc.support.nativejdbc.OracleJdbc4NativeJdbcExtractor Maven / Gradle / Ivy

There is a newer version: 6.1.6
Show newest version
/*
 * Copyright 2002-2012 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.springframework.jdbc.support.nativejdbc;

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;

/**
 * A {@link Jdbc4NativeJdbcExtractor} which comes pre-configured for Oracle's JDBC driver,
 * specifying the following vendor-specific API types for unwrapping:
 * 
    *
  • {@code oracle.jdbc.OracleConnection} *
  • {@code oracle.jdbc.OracleStatement} *
  • {@code oracle.jdbc.OraclePreparedStatement} *
  • {@code oracle.jdbc.OracleCallableStatement} *
  • {@code oracle.jdbc.OracleResultSet} *
* *

Note: This will work with any JDBC 4.0 compliant connection pool, without a need for * connection pool specific setup. In other words, as of JDBC 4.0, NativeJdbcExtractors * will typically be implemented for specific drivers instead of for specific pools. * * @author Juergen Hoeller * @since 3.0.5 */ public class OracleJdbc4NativeJdbcExtractor extends Jdbc4NativeJdbcExtractor { @SuppressWarnings("unchecked") public OracleJdbc4NativeJdbcExtractor() { try { setConnectionType((Class) getClass().getClassLoader().loadClass("oracle.jdbc.OracleConnection")); setStatementType((Class) getClass().getClassLoader().loadClass("oracle.jdbc.OracleStatement")); setPreparedStatementType((Class) getClass().getClassLoader().loadClass("oracle.jdbc.OraclePreparedStatement")); setCallableStatementType((Class) getClass().getClassLoader().loadClass("oracle.jdbc.OracleCallableStatement")); setResultSetType((Class) getClass().getClassLoader().loadClass("oracle.jdbc.OracleResultSet")); } catch (Exception ex) { throw new IllegalStateException( "Could not initialize OracleJdbc4NativeJdbcExtractor because Oracle API classes are not available: " + ex); } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy