From 0fc41e9f70a368544dbe828c15324d1e7e14984b Mon Sep 17 00:00:00 2001 From: richie Date: Fri, 6 Sep 2019 11:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BF=9E=E6=8E=A5=E6=8A=BD?= =?UTF-8?q?=E8=B1=A1=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fanruan/api/data/open/BaseConnection.java | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/main/java/com/fanruan/api/data/open/BaseConnection.java diff --git a/src/main/java/com/fanruan/api/data/open/BaseConnection.java b/src/main/java/com/fanruan/api/data/open/BaseConnection.java new file mode 100644 index 0000000..95d8c0c --- /dev/null +++ b/src/main/java/com/fanruan/api/data/open/BaseConnection.java @@ -0,0 +1,51 @@ +package com.fanruan.api.data.open; + +import com.fanruan.api.util.ArrayKit; +import com.fr.data.impl.AbstractDatabaseConnection; +import com.fr.data.impl.Connection; + +/** + * @author richie + * @version 10.0 + * Created by richie on 2019-09-06 + * 用于数据连接插件的抽象类 + */ +public abstract class BaseConnection extends AbstractDatabaseConnection { + + /** + * 测试连接 + * + * @throws Exception 异常 + */ + @Override + public abstract void testConnection() throws Exception; + + /** + * 创建连接 + * + * @return 返回连接 + * @throws Exception 异常 + */ + @Override + public java.sql.Connection createConnection() throws Exception { + return Connection.IGNORE; + } + + /** + * 连接成功或失败时给出的信息 + * + * @return 信息 + */ + @Override + public abstract String connectMessage(boolean status); + + + /** + * 获取数据连接的摘要信息 + * + * @return 摘要 + */ + public String[] summary(String... args) { + return ArrayKit.EMPTY_STRING_ARRAY; + } +}