This commit is contained in:
Looly
2022-04-30 20:59:02 +08:00
parent 5a33a8320e
commit 9a1ffb25ff
3 changed files with 14 additions and 3 deletions

View File

@@ -1,5 +1,8 @@
package cn.hutool.db.ds.simple;
import cn.hutool.core.clone.CloneRuntimeException;
import javax.sql.DataSource;
import java.io.Closeable;
import java.io.PrintWriter;
import java.sql.DriverManager;
@@ -7,8 +10,6 @@ import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.util.logging.Logger;
import javax.sql.DataSource;
/**
* 数据源抽象实现
* @author Looly
@@ -53,4 +54,13 @@ public abstract class AbstractDataSource implements DataSource, Cloneable, Close
public Logger getParentLogger() throws SQLFeatureNotSupportedException {
throw new SQLFeatureNotSupportedException("DataSource can't support getParentLogger method!");
}
@Override
public AbstractDataSource clone() {
try {
return (AbstractDataSource) super.clone();
} catch (final CloneNotSupportedException e) {
throw new CloneRuntimeException(e);
}
}
}