日期:2014-05-16  浏览次数:20423 次

判断数据库是否打开
/**
	 * 判断数据库是否连接
	 * 
	 * @return
	 */
	public static boolean isConnected() {
		Connection conn = DBHelper.getConn();
		try {
			if (null != conn) {
				if (!conn.isClosed()) {
					isPass = true;
				}
			}
		} catch (Exception e) {
			isPass = false;
			e.printStackTrace();
		} finally {
			closeAll(conn);
		}
		return isPass;
	}