提交 d3c0dd1c 编写于 作者: J Juergen Hoeller 提交者: unknown

Minor javadoc updates

上级 99c7f25b
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
......@@ -23,15 +23,16 @@ import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.PreparedStatementCallback;
import org.springframework.jdbc.support.lob.LobCreator;
import org.springframework.jdbc.support.lob.LobHandler;
import org.springframework.util.Assert;
/**
* Abstract PreparedStatementCallback implementation that manages a LobCreator.
* Abstract {@link PreparedStatementCallback} implementation that manages a {@link LobCreator}.
* Typically used as inner class, with access to surrounding method arguments.
*
* <p>Delegates to the {@code setValues} template method for setting values
* on the PreparedStatement, using a given LobCreator for BLOB/CLOB arguments.
*
* <p>A usage example with JdbcTemplate:
* <p>A usage example with {@link org.springframework.jdbc.core.JdbcTemplate}:
*
* <pre class="code">JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); // reusable object
* LobHandler lobHandler = new DefaultLobHandler(); // reusable object
......@@ -62,6 +63,7 @@ public abstract class AbstractLobCreatingPreparedStatementCallback implements Pr
* @param lobHandler the LobHandler to create LobCreators with
*/
public AbstractLobCreatingPreparedStatementCallback(LobHandler lobHandler) {
Assert.notNull(lobHandler, "LobHandler must not be null");
this.lobHandler = lobHandler;
}
......
/*
* Copyright 2002-2005 the original author or authors.
* Copyright 2002-2013 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.
......@@ -22,7 +22,7 @@ import java.sql.ResultSet;
import java.sql.SQLException;
/**
* Abstract base class for LobHandler implementations.
* Abstract base class for {@link LobHandler} implementations.
*
* <p>Implements all accessor methods for column names through a column lookup
* and delegating to the corresponding accessor that takes a column index.
......
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
......@@ -24,7 +24,7 @@ import org.springframework.util.ReflectionUtils;
/**
* Implementation of the {@link NativeJdbcExtractor} interface for WebLogic,
* supporting WebLogic Server 8.1 and higher.
* supporting WebLogic Server 9.0 and higher.
*
* <p>Returns the underlying native Connection to application code instead
* of WebLogic's wrapper implementation; unwraps the Connection for native
......
/*
* Copyright 2002-2012 the original author or authors.
* Copyright 2002-2013 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.
......@@ -24,7 +24,7 @@ import org.springframework.util.ReflectionUtils;
/**
* Implementation of the {@link NativeJdbcExtractor} interface for WebSphere,
* supporting WebSphere Application Server 5.1 and higher.
* supporting WebSphere Application Server 6.1 and higher.
*
* <p>Returns the underlying native Connection to application code instead
* of WebSphere's wrapper implementation; unwraps the Connection for
......@@ -40,14 +40,14 @@ import org.springframework.util.ReflectionUtils;
*/
public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
private static final String JDBC_ADAPTER_CONNECTION_NAME_5 = "com.ibm.ws.rsadapter.jdbc.WSJdbcConnection";
private static final String JDBC_ADAPTER_CONNECTION_NAME = "com.ibm.ws.rsadapter.jdbc.WSJdbcConnection";
private static final String JDBC_ADAPTER_UTIL_NAME_5 = "com.ibm.ws.rsadapter.jdbc.WSJdbcUtil";
private static final String JDBC_ADAPTER_UTIL_NAME = "com.ibm.ws.rsadapter.jdbc.WSJdbcUtil";
private Class webSphere5ConnectionClass;
private Class webSphereConnectionClass;
private Method webSphere5NativeConnectionMethod;
private Method webSphereNativeConnectionMethod;
/**
......@@ -56,10 +56,10 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
*/
public WebSphereNativeJdbcExtractor() {
try {
this.webSphere5ConnectionClass = getClass().getClassLoader().loadClass(JDBC_ADAPTER_CONNECTION_NAME_5);
Class jdbcAdapterUtilClass = getClass().getClassLoader().loadClass(JDBC_ADAPTER_UTIL_NAME_5);
this.webSphere5NativeConnectionMethod =
jdbcAdapterUtilClass.getMethod("getNativeConnection", new Class[] {this.webSphere5ConnectionClass});
this.webSphereConnectionClass = getClass().getClassLoader().loadClass(JDBC_ADAPTER_CONNECTION_NAME);
Class jdbcAdapterUtilClass = getClass().getClassLoader().loadClass(JDBC_ADAPTER_UTIL_NAME);
this.webSphereNativeConnectionMethod =
jdbcAdapterUtilClass.getMethod("getNativeConnection", new Class[] {this.webSphereConnectionClass});
}
catch (Exception ex) {
throw new IllegalStateException(
......@@ -97,9 +97,8 @@ public class WebSphereNativeJdbcExtractor extends NativeJdbcExtractorAdapter {
*/
@Override
protected Connection doGetNativeConnection(Connection con) throws SQLException {
if (this.webSphere5ConnectionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeJdbcMethod(
this.webSphere5NativeConnectionMethod, null, new Object[] {con});
if (this.webSphereConnectionClass.isAssignableFrom(con.getClass())) {
return (Connection) ReflectionUtils.invokeJdbcMethod(this.webSphereNativeConnectionMethod, null, con);
}
return con;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册