cn.remex.db.rsql.connection
类 RDBConnection

java.lang.Object
  继承者 cn.remex.db.rsql.connection.RDBConnection

public class RDBConnection
extends Object

改写了java.sql.Connection
此对象是为了数据库池的自动调用,回收,并且保证回收的正确性重写的。


构造方法摘要
RDBConnection(String poolName)
           
 
方法摘要
 CallableStatement callableStatement(String sql)
           
 void commit()
          改写的java.sql.Connection.commit()
 Statement createStatement()
           
 void free()
          用于向数据库池返回已使用完的连接。
 String getPoolName()
           
 RDBSpaceConfig getSpaceConfig()
           
 boolean isOK()
          用于检查数据库连接是否正常的方法
 PreparedStatement prepareStatement(String sql)
          改写的java.sql.Connection.prepareStatement(String sql)
 PreparedStatement prepareStatement(String sql, int autoGeneratedKeys)
           
 PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
          改写的java.sql.Connection.prepareStatement(sql, resultSetType, resultSetConcurrency)
 PreparedStatement prepareStatement(String sqlString, String[] obtainPSKeys)
           
 void rollback()
          改写的java.sql.Connection.rollback()
 void setAutoCommit(boolean b)
          改写的java.sql.Connection.setAutoCommit(boolean)
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

RDBConnection

public RDBConnection(String poolName)
方法详细信息

getPoolName

public String getPoolName()

commit

public void commit()
            throws SQLException
改写的java.sql.Connection.commit()

抛出:
SQLException

free

public void free()
用于向数据库池返回已使用完的连接。 此对象中的commit(),rollback(),已包含此操作


getSpaceConfig

public RDBSpaceConfig getSpaceConfig()

isOK

public boolean isOK()
用于检查数据库连接是否正常的方法

返回:
boolean

prepareStatement

public PreparedStatement prepareStatement(String sql)
                                   throws SQLException
改写的java.sql.Connection.prepareStatement(String sql)

参数:
sql -
返回:
PreparedStatement
抛出:
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int autoGeneratedKeys)
                                   throws SQLException
参数:
sql -
autoGeneratedKeys - autoGeneratedKeys a flag indicating whether auto-generated keys should be returned; one of Statement.RETURN_GENERATED_KEYS or Statement.NO_GENERATED_KEYS
返回:
a new PreparedStatement object, containing the pre-compiled SQL statement, that will have the capability of returning auto-generated keys
抛出:
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sql,
                                          int resultSetType,
                                          int resultSetConcurrency)
                                   throws SQLException
改写的java.sql.Connection.prepareStatement(sql, resultSetType, resultSetConcurrency)

参数:
sql -
resultSetType -
resultSetConcurrency -
返回:
PreparedStatement
抛出:
SQLException

prepareStatement

public PreparedStatement prepareStatement(String sqlString,
                                          String[] obtainPSKeys)
                                   throws SQLException
参数:
sqlString -
obtainPSKeys -
返回:
PreparedStatement
抛出:
SQLException

callableStatement

public CallableStatement callableStatement(String sql)
                                    throws SQLException
抛出:
SQLException

createStatement

public Statement createStatement()
                          throws SQLException
返回:
Statement
抛出:
SQLException

rollback

public void rollback()
              throws SQLException
改写的java.sql.Connection.rollback()

抛出:
SQLException

setAutoCommit

public void setAutoCommit(boolean b)
改写的java.sql.Connection.setAutoCommit(boolean)

参数:
b -
抛出:
SQLException


Copyright © 2016. All rights reserved.