public class XgDataSource extends Object implements DataSource, Referenceable, Serializable
| 限定符和类型 | 字段和说明 |
|---|---|
protected String |
databaseName |
protected Connection |
dsConnection |
protected boolean |
explicitUrl
是否外部明显设置了连接URL,true为外部显式设置了连接
|
protected String |
hostName |
protected int |
loginTimeout |
protected PrintWriter |
logWriter |
protected int |
maxActive
最大活动连接数
|
protected long |
maxWaitTime
最大等待时间
|
protected int |
minIdle
连接池中最少连接数
|
protected String |
password |
protected int |
port |
protected Properties |
pro |
protected String |
url
连接需要的一些属性参数
|
protected String |
user |
protected static Driver |
xgDriver |
| 构造器和说明 |
|---|
XgDataSource() |
protected static Driver xgDriver
protected String url
protected String hostName
protected String databaseName
protected String user
protected String password
protected int port
protected Properties pro
protected PrintWriter logWriter
protected int loginTimeout
protected Connection dsConnection
protected long maxWaitTime
protected int maxActive
protected int minIdle
protected boolean explicitUrl
protected void writeBaseObject(ObjectOutputStream out) throws IOException
IOExceptionprotected void readBaseObject(ObjectInputStream in) throws IOException, ClassNotFoundException
public long getMaxWaitTime()
public void setMaxWaitTime(long maxWaitTime)
public int getMaxActive()
public void setMaxActive(int maxActive)
public int getMinIdle()
public void setMinIdle(int minIdle)
public String getDatabaseName()
public void setDatabaseName(String databaseName)
public String getHostName()
public void setHostName(String hostName)
public String getPassword()
public void setPassword(String password)
public int getPort()
public void setPort(int port)
public void setConnection(Connection con)
public String getUrl()
public void setUrl(String url)
public String getUser()
public void setUser(String user)
public Connection getConnection() throws SQLException
getConnection 在接口中 DataSourceSQLExceptionpublic Connection getConnection(String username, String password) throws SQLException
getConnection 在接口中 DataSourceSQLExceptionprotected Connection getConnection(Properties props) throws SQLException
SQLExceptionpublic PrintWriter getLogWriter() throws SQLException
getLogWriter 在接口中 CommonDataSourceSQLExceptionpublic int getLoginTimeout()
getLoginTimeout 在接口中 CommonDataSourcepublic void setLogWriter(PrintWriter out) throws SQLException
setLogWriter 在接口中 CommonDataSourceSQLExceptionpublic void setLoginTimeout(int seconds)
setLoginTimeout 在接口中 CommonDataSourcepublic boolean isWrapperFor(Class iface) throws SQLException
isWrapperFor 在接口中 WrapperSQLExceptionpublic Reference getReference() throws NamingException
Referenceable.getReference 在接口中 ReferenceableNamingException - if a JNDI error occurspublic Properties getPro()
public void setPro(Properties ds_pro)
public Logger getParentLogger() throws SQLFeatureNotSupportedException
getParentLogger 在接口中 CommonDataSourceSQLFeatureNotSupportedExceptionpublic Object unwrap(Class arg0) throws SQLException
unwrap 在接口中 WrapperSQLExceptionCopyright © 2025. All rights reserved.