public interface CommonDataSource
DataSource
之间,
XADataSource
和
ConnectionPoolDataSource
。
Modifier and Type | Method and Description |
---|---|
int |
getLoginTimeout()
获取此数据源在试图连接到数据库时所能等待的最大时间秒数。
|
PrintWriter |
getLogWriter()
检索此
DataSource 对象的写日志。
|
Logger |
getParentLogger()
返回所有的数据源使用的记录仪父记录器。
|
void |
setLoginTimeout(int seconds)
设置在试图连接到数据库时,该数据源将等待的最大时间秒数。
|
void |
setLogWriter(PrintWriter out)
设置此
DataSource 对象到给定的
java.io.PrintWriter 对象的写日志。
|
PrintWriter getLogWriter() throws SQLException
检索此DataSource
对象的写日志。
日志写入器是一个字符输出流,该数据源的所有日志记录和跟踪消息将被打印出来。这包括这个对象的方法打印的消息,通过该对象制造的其他对象的方法打印的消息,等等。打印到特定数据源的日志写入消息不印刷与java.sql.DriverManager
类关联的写日志。当一个DataSource
对象创建时,日志作家最初是空的;换句话说,默认为日志被禁用。
SQLException
-如果一个数据库访问错误发生
setLogWriter(java.io.PrintWriter)
void setLogWriter(PrintWriter out) throws SQLException
设置此DataSource
对象到给定的java.io.PrintWriter
对象的写日志。
日志写入器是一个字符输出流,该数据源的所有日志记录和跟踪消息将被打印出来。这包括这个对象的方法打印的消息,通过该对象制造的其他对象的方法打印的消息,等等。打印数据源特定的日志写入消息不印刷与java.sql.DriverManager
类关联的写日志。当一个DataSource
对象创建日志作家最初是空的;换句话说,默认为日志被禁用。
out
-新日志作家;禁用日志记录,设置为null
SQLException
-如果一个数据库访问错误发生
getLogWriter()
void setLoginTimeout(int seconds) throws SQLException
设置在试图连接到数据库时,该数据源将等待的最大时间秒数。一个零的值指定的超时是默认的系统超时,如果有一个,否则,它指定没有超时。当一个DataSource
对象被创建,登录超时最初是零。
seconds
-数据源登录时间限制
SQLException
-如果一个数据库访问错误发生。
getLoginTimeout()
int getLoginTimeout() throws SQLException
DataSource
对象被创建,登录超时最初是零。
SQLException
-如果一个数据库访问错误发生。
setLoginTimeout(int)
Logger getParentLogger() throws SQLFeatureNotSupportedException
SQLFeatureNotSupportedException
如果数据源不使用
java.util.logging
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.