DataSource增加getType()方法
This commit is contained in:
@@ -64,6 +64,11 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
|||||||
protected void preConstruct(String unitName, Properties readprop, Properties writeprop) {
|
protected void preConstruct(String unitName, Properties readprop, Properties writeprop) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getType() {
|
||||||
|
return "jdbc";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String resourceName() {
|
public final String resourceName() {
|
||||||
return name;
|
return name;
|
||||||
@@ -75,6 +80,14 @@ public class DataJdbcSource extends AbstractService implements DataSource, DataC
|
|||||||
writePool.close();
|
writePool.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public PoolJdbcSource getReadPoolJdbcSource() {
|
||||||
|
return readPool;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PoolJdbcSource getWritePoolJdbcSource() {
|
||||||
|
return writePool;
|
||||||
|
}
|
||||||
|
|
||||||
public Connection createReadSQLConnection() {
|
public Connection createReadSQLConnection() {
|
||||||
return readPool.poll();
|
return readPool.poll();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ import org.redkale.util.*;
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public interface DataSource {
|
public interface DataSource {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取数据源类型
|
||||||
|
*
|
||||||
|
* @return String
|
||||||
|
*/
|
||||||
|
public String getType();
|
||||||
|
|
||||||
//----------------------insertAsync-----------------------------
|
//----------------------insertAsync-----------------------------
|
||||||
/**
|
/**
|
||||||
* 新增记录, 多对象必须是同一个Entity类 <br>
|
* 新增记录, 多对象必须是同一个Entity类 <br>
|
||||||
|
|||||||
Reference in New Issue
Block a user