JDK中sql包下DataSource接口源码
来源:互联网 发布:ubuntu 释放内存 编辑:程序博客网 时间:2024/06/16 06:08
DataSource接口源码
/** * <p>A factory for connections to the physical data source that this * <code>DataSource</code> object represents. An alternative to the * <code>DriverManager</code> facility, a <code>DataSource</code> object * is the preferred means of getting a connection. An object that implements * the <code>DataSource</code> interface will typically be * registered with a naming service based on the * Java<sup><font size=-2>TM</font></sup> Naming and Directory (JNDI) API. * <P> * The <code>DataSource</code> interface is implemented by a driver vendor. * There are three types of implementations: * <OL> * <LI>Basic implementation -- produces a standard <code>Connection</code> * object * <LI>Connection pooling implementation -- produces a <code>Connection</code> * object that will automatically participate in connection pooling. This * implementation works with a middle-tier connection pooling manager. * <LI>Distributed transaction implementation -- produces a * <code>Connection</code> object that may be used for distributed * transactions and almost always participates in connection pooling. * This implementation works with a middle-tier * transaction manager and almost always with a connection * pooling manager. * </OL> * <P> * A <code>DataSource</code> object has properties that can be modified * when necessary. For example, if the data source is moved to a different * server, the property for the server can be changed. The benefit is that * because the data source's properties can be changed, any code accessing * that data source does not need to be changed. * <P> * A driver that is accessed via a <code>DataSource</code> object does not * register itself with the <code>DriverManager</code>. Rather, a * <code>DataSource</code> object is retrieved though a lookup operation * and then used to create a <code>Connection</code> object. With a basic * implementation, the connection obtained through a <code>DataSource</code> * object is identical to a connection obtained through the * <code>DriverManager</code> facility. * * @since 1.4 */public interface DataSource extends CommonDataSource,Wrapper { Connection getConnection() throws SQLException; Connection getConnection(String username, String password) throws SQLException;}
/** * Interface that defines the methods which are common between <code>DataSource</code>, * <code>XADataSource</code> and <code>ConnectionPoolDataSource</code>. *<p> */public interface CommonDataSource { java.io.PrintWriter getLogWriter() throws SQLException; void setLogWriter(java.io.PrintWriter out) throws SQLException; void setLoginTimeout(int seconds) throws SQLException; int getLoginTimeout() throws SQLException; }
/** * Interface for JDBC classes which provide the ability to retrieve the delegate instance when the instance * in question is in fact a proxy class. * <p> * The wrapper pattern is employed by many JDBC driver implementations to provide extensions beyond * the traditional JDBC API that are specific to a data source. Developers may wish to gain access to * these resources that are wrapped (the delegates) as proxy class instances representing the * the actual resources. This interface describes a standard mechanism to access * these wrapped resources * represented by their proxy, to permit direct access to the resource delegates. * * @since 1.6 */public interface Wrapper { /** * Returns an object that implements the given interface to allow access to * non-standard methods, or standard methods not exposed by the proxy. */<T> T unwrap(java.lang.Class<T> iface) throws java.sql.SQLException; /** * Returns true if this either implements the interface argument or is directly or indirectly a wrapper * for an object that does. Returns false otherwise. If this implements the interface then return true, * else if this is a wrapper then return the result of recursively calling <code>isWrapperFor</code> on the wrapped * object. If this does not implement the interface and is not a wrapper, return false. * This method should be implemented as a low-cost operation compared to <code>unwrap</code> so that * callers can use this method to avoid expensive <code>unwrap</code> calls that may fail. If this method * returns true then calling <code>unwrap</code> with the same argument should succeed. */ boolean isWrapperFor(java.lang.Class<?> iface) throws java.sql.SQLException;}
0 0
- JDK中sql包下DataSource接口源码
- javax.sql.DataSource接口
- javax.sql.DataSource接口
- linux下JDK源码包配置
- JDK中jar包下的类
- JDK中reflect包下的类
- JDK中annotation包下的类
- JDK中text包下的类
- JDK中rmi包下的类
- 黑马程序员:抽象类/接口/异常/jdk中常用包
- eclipse中关联jdk、jar包的源码
- mybatis org.apache.ibatis.datasource包源码分析
- mybatis源码学习之org.apache.ibatis.datasource.jndi包
- jdk源码之Collection接口
- JDK源码包结构分类
- JDK源码包结构分类
- JDK源码包结构分类
- jdk下常用文件夹以及java中常用的包
- HDU 2209 翻纸牌游戏 By Assassin 模拟
- 基础知识(字符串,数组,对象)
- intellij idea maven 配置使用
- ActionResult 返回类型
- Linux权限管理之文件默认权限
- JDK中sql包下DataSource接口源码
- ng2功能模块
- JNI学习笔记
- Spring学习历程---request,session与globalSession作用域
- android数据库SQLite
- SSH网站开发实录(4)(实现登录功能)SpringMVC+Spring+Hibernate
- 为Android频繁的网络请求设置本地缓存
- js替换字符
- 学历查询*Oregon夏威夷商学院毕业.代递交认证材料