Commit Graph

598 Commits

Author SHA1 Message Date
lidongdai
76323482be remove master cpu load avg 2019-06-24 11:40:23 +08:00
lidongdai
a964e2014a delete nouse code 2019-06-17 15:40:55 +08:00
lidongdai
d7af3678ee add info: master send heartbeat to zk failed: can't find zookeeper regist path of master server 2019-06-10 16:40:26 +08:00
lidongdai
1f8cc8a807 add api docs 2019-05-27 18:09:50 +08:00
lidongdai
da278c295c add ServiceModelToSwagger 2019-05-25 19:04:18 +08:00
lidongdai
85a66588cd update api docs 2019-05-25 18:50:48 +08:00
lidongdai
20734d3cea update api docs 2019-05-25 18:20:46 +08:00
lidongdai
d9bf06d804 添加api文档 2019-05-23 18:30:33 +08:00
lidongdai
bb1fa37e31 use swagger for api docs 2019-05-17 18:50:10 +08:00
lidongdai
dc55de4e86 1.0.2文档发布 2019-05-15 15:38:46 +08:00
lidongdai
06acbe5fd5 1.0.2文档发布 2019-05-13 20:27:42 +08:00
dailidong
5a8c8ef943 1.0.2文档发布 2019-05-10 11:05:12 +08:00
dailidong
607fdcb701 Merge remote-tracking branch 'upstream/dev' into dev 2019-05-07 17:57:19 +08:00
dailidong
541547e5b9 /*
* Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cn.escheduler.common.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.*;

public class MysqlUtils {

	public static final Logger logger = LoggerFactory.getLogger(MysqlUtils.class);

	private static MysqlUtils instance;

	MysqlUtils() {
	}

	public static MysqlUtils getInstance() {
		if (null == instance) {
			syncInit();
		}
		return instance;
	}

	private static synchronized void syncInit() {
		if (instance == null) {
			instance = new MysqlUtils();
		}
	}

	public void release(ResultSet rs, Statement stmt, Connection conn) {
		try {
			if (rs != null) {
				rs.close();
				rs = null;
			}
		} catch (SQLException e) {
			logger.error(e.getMessage(),e);
			throw new RuntimeException(e);
		} finally {
			try {
				if (stmt != null) {
					stmt.close();
					stmt = null;
				}
			} catch (SQLException e) {
				logger.error(e.getMessage(),e);
				throw new RuntimeException(e);
			} finally {
				try {
					if (conn != null) {
						conn.close();
						conn = null;
					}
				} catch (SQLException e) {
					logger.error(e.getMessage(),e);
					throw new RuntimeException(e);
				}
			}
		}
	}

	public static void releaseResource(ResultSet rs, PreparedStatement ps, Connection conn) {
		MysqlUtils.getInstance().release(rs,ps,conn);
		if (null != rs) {
			try {
				rs.close();
			} catch (SQLException e) {
				logger.error(e.getMessage(),e);
			}
		}

		if (null != ps) {
			try {
				ps.close();
			} catch (SQLException e) {
				logger.error(e.getMessage(),e);
			}
		}

		if (null != conn) {
			try {
				conn.close();
			} catch (SQLException e) {
				logger.error(e.getMessage(),e);
			}
		}
	}
}
2019-05-07 17:03:37 +08:00
easyscheduler
b70ad4c7c1
Merge pull request #227 from chgxtony/dev
upgrade  spring-boot to 2.1.x and spring to 5.x
2019-05-07 16:15:00 +08:00
dailidong
ef803cc963 Merge remote-tracking branch 'upstream/dev' into dev 2019-05-07 11:49:26 +08:00
bao liang
3efdff3d80
Merge pull request #240 from analysys/branch-1.0.2
fix bug: error command id is 0.
2019-04-30 15:22:17 +08:00
bao liang
2690340bff
Merge pull request #239 from lenboo/branch-1.0.2
fix bug: error command id is 0.
2019-04-30 15:21:36 +08:00
baoliang
fce91b15e1 fix bug: error command id is 0. 2019-04-30 15:07:41 +08:00
乔占卫
7331bf99be
Merge pull request #237 from qiaozhanwei/dev
project index date update
2019-04-30 14:09:43 +08:00
qiaozhanwei
33b8a429b2 project index date update 2019-04-30 14:08:02 +08:00
bao liang
ececcbdb91
Merge pull request #229 from samz406/dev
提示信息不准确
2019-04-30 13:49:41 +08:00
baoliang
ce571c53a1 update documents, remove demo and password 2019-04-30 11:20:07 +08:00
baoliang
1a371264fe update documents 2019-04-30 11:11:45 +08:00
dailidong
d6ba10269c Merge remote-tracking branch 'upstream/dev' into dev 2019-04-29 23:31:04 +08:00
lilin
84426d323a 提示信息不正确 2019-04-29 16:49:43 +08:00
lilin
00ba3cd628 修改如果用户没有创建资源时给用户授权资源会报空指针 2019-04-29 16:49:08 +08:00
lilin
2243d8f09e Merge remote-tracking branch 'upstream/dev' into dev 2019-04-29 15:53:15 +08:00
baoliang
84d95eef92 Merge remote-tracking branch 'upstream/dev-20190415' into dev-up 2019-04-29 14:50:54 +08:00
chgxtony
958556e61b upgrade spring-boot to 2.1.x and spring to 5.x 2019-04-29 14:09:09 +08:00
millionfor
8205e7e2e4
Merge pull request #225 from millionfor/dev-20190415
Dev 20190415
2019-04-29 10:51:03 +08:00
gongzijian
9da5ca9df1 Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415 2019-04-29 10:50:24 +08:00
gongzijian
5782824055 修复删除节点未删除locations节点信息bug 2019-04-29 10:50:12 +08:00
乔占卫
92862dc8d6
Merge pull request #224 from qiaozhanwei/dev-20190415
admin user update
2019-04-29 10:48:23 +08:00
qiaozhanwei
07014b593d admin user update 2019-04-29 10:20:40 +08:00
bao liang
29e3d67631
Merge pull request #223 from lenboo/dev-20190415
update documents
2019-04-28 19:52:05 +08:00
baoliang
fbbeef143d update documents 2019-04-28 19:51:15 +08:00
bao liang
69e8ea6d27
Merge pull request #222 from lenboo/dev-20190415
update documents
2019-04-28 19:44:15 +08:00
baoliang
fbd7ac921c update documents 2019-04-28 19:39:11 +08:00
baoliang
ebacdfaab5 Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415 2019-04-28 18:57:51 +08:00
millionfor
9bab24c292
Merge pull request #221 from millionfor/dev-20190415
Dev 20190415
2019-04-28 18:48:15 +08:00
gongzijian
5b6c43d10c Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415 2019-04-28 18:47:42 +08:00
gongzijian
099550bd76 隐藏任务记录 2019-04-28 18:46:37 +08:00
millionfor
76468b6179
Merge pull request #220 from millionfor/dev-20190415
Dev 20190415
2019-04-28 18:24:23 +08:00
gongzijian
e441e124ec Merge remote-tracking branch 'upstream/dev-20190415' into dev-20190415 2019-04-28 18:23:33 +08:00
gongzijian
b2eb9eb268 build 2019-04-28 18:23:14 +08:00
gongzijian
c222386ddd 文档 用户编辑bug 中英 2019-04-28 18:21:30 +08:00
bao liang
652ec2b6ee
Merge pull request #218 from lenboo/dev
merge from dev-20190415
2019-04-28 17:49:02 +08:00
baoliang
b664be5714 update en_US.js 2019-04-28 17:46:20 +08:00
baoliang
f4450b35a5 Merge remote-tracking branch 'upstream/dev' into dev
# Conflicts:
#	docs/zh_CN/images/mysql_edit.png
2019-04-28 17:05:44 +08:00