|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
public interface CommonDataSource
此接口定义在 DataSource、XADataSource 和 ConnectionPoolDataSource 之间公用的方法。
| 方法摘要 | |
|---|---|
int |
getLoginTimeout()
获取此数据源试图连接到某一数据库时可以等待的最长时间,以秒为单位。 |
PrintWriter |
getLogWriter()
获取此 DataSource 对象的日志 writer。 |
void |
setLoginTimeout(int seconds)
设置此数据源试图连接到某一数据库时将等待的最长时间,以秒为单位。 |
void |
setLogWriter(PrintWriter out)
将此 DataSource 对象的日志 writer 设置为给定的 java.io.PrintWriter 对象。 |
| 方法详细信息 |
|---|
PrintWriter getLogWriter()
throws SQLException
获取此 DataSource 对象的日志 writer。
日志 writer 是一个字符输出流,此数据源的所有日志记录和跟踪消息都将被打印到该输出流。这包括由此对象的方法打印的消息、由此对象构造的其他对象的方法打印的消息等等。打印到特定于数据源的日志 writer 的消息不会被打印到与 java.sql.DriverManager 类关联的日志 writer。创建 DataSource 对象时,日志 writer 最初为 null;换句话说,默认为禁用日志记录。
SQLException - 如果发生数据库访问错误setLogWriter(java.io.PrintWriter)
void setLogWriter(PrintWriter out)
throws SQLException
将此 DataSource 对象的日志 writer 设置为给定的 java.io.PrintWriter 对象。
日志 writer 是一个字符输出流,此数据源的所有日志记录和跟踪消息都将被打印到该输出流。这包括由此对象的方法打印的消息、由此对象构造的其他对象的方法打印的消息等等。打印到特定于数据源的日志 writer 的消息不会被打印到与 java.sql.DriverManager 类关联的日志 writer。创建 DataSource 对象时,日志 writer 最初为 null;换句话说,默认为禁用日志记录。
out - 新的日志 writer;如果要禁用日志记录,则设置为 null
SQLException - 如果发生数据库访问错误getLogWriter()
void setLoginTimeout(int seconds)
throws SQLException
设置此数据源试图连接到某一数据库时将等待的最长时间,以秒为单位。值为 0 表示超时值为默认的系统超时值(如果有);否则它表示不存在超时值。创建 DataSource 对象时,登录超时值最初为 0。
seconds - 数据源登录超时值
SQLException - 如果发生数据库访问错误。getLoginTimeout()
int getLoginTimeout()
throws SQLException
DataSource 对象时,登录超时值最初为 0。
SQLException - 如果发生数据库访问错误。setLoginTimeout(int)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。