mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
add more error info.
This commit is contained in:
@@ -316,6 +316,17 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
String property = properties.getProperty("druid.maxWait");
|
||||
if (property != null && property.length() > 0) {
|
||||
try {
|
||||
int value = Integer.parseInt(property);
|
||||
this.setMaxWait(value);
|
||||
} catch (NumberFormatException e) {
|
||||
LOG.error("illegal property 'druid.maxWait'", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean value = getBoolean(properties, "druid.failFast");
|
||||
if (value != null) {
|
||||
@@ -1519,6 +1530,10 @@ public class DruidDataSource extends DruidAbstractDataSource implements DruidDat
|
||||
}
|
||||
}
|
||||
|
||||
if (createErrorCount > 0) {
|
||||
buf.append(", createErrorCount ").append(createErrorCount);
|
||||
}
|
||||
|
||||
List<JdbcSqlStatValue> sqlList = this.getDataSourceStat().getRuningSqlList();
|
||||
for (int i = 0; i < sqlList.size(); ++i) {
|
||||
if (i != 0) {
|
||||
|
||||
@@ -1150,14 +1150,6 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
}
|
||||
|
||||
private void checkStateInternal() throws SQLException {
|
||||
if (holder == null) {
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection holder is null", disableError);
|
||||
} else {
|
||||
throw new SQLException("connection holder is null");
|
||||
}
|
||||
}
|
||||
|
||||
if (closed) {
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection closed", disableError);
|
||||
@@ -1173,6 +1165,14 @@ public class DruidPooledConnection extends PoolableWrapper implements javax.sql.
|
||||
throw new SQLException("connection disabled");
|
||||
}
|
||||
}
|
||||
|
||||
if (holder == null) {
|
||||
if (disableError != null) {
|
||||
throw new SQLException("connection holder is null", disableError);
|
||||
} else {
|
||||
throw new SQLException("connection holder is null");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
|
||||
Reference in New Issue
Block a user