如何使用jdbc检索vertica集群的节点名称

时间:2017-03-08 10:41:47

标签: vertica

有没有办法使用jdbc检索vertica集群的节点名称?

为了实现容错的连接策略?

可以从此retConnection连接实例中检索吗?

Connection retConnection = null;
.
.
.
retConnection = DriverManager.getConnection
                (
                        connectionString,
                        connectionProperties
                );

感谢。

1 个答案:

答案 0 :(得分:2)

怎么样......

function breadcrumbPoints(d, i) {
    	  var points = [];
    	  points.push("0,0");
    	  points.push(b.w*2 + ",0");
    	  points.push(b.w*2 + b.t + "," + (b.h / 2));
    	  points.push(b.w*2 + "," + b.h);
    	  points.push("0," + b.h);
    	  if (i > 0) { // Leftmost breadcrumb; don't include 6th vertex.
    	    points.push(b.t + "," + (b.h / 2));
    	  }
    	  return points.join(" ");
    	}

    	// Update the breadcrumb trail to show the current sequence and percentage.
    	function updateBreadcrumbs(nodeArray, percentageString) {

    	  // Data join; key function combines name and depth (= position in sequence).
    	  var g = d3.select("#trail")
    	      .selectAll("g")
    	      .data(nodeArray, function(d) { return d.name + d.depth; });

    	  // Add breadcrumb and label for entering nodes.
    	  var entering = g.enter().append("svg:g");

    	  entering.append("svg:polygon")
    	      .attr("points", breadcrumbPoints)
    	      .style("fill", function(d) { return color((d.children ? d : d.parent).name); })
    	    //  .style("fill", function(d) { return colors[d.name]; });

    	  entering.append("svg:text")
    	      .attr("x", (b.w + b.t/2))
    	      .attr("y", b.h /2)
    	      .attr("dy", "0.36em")
    	      .attr("text-anchor", "middle")
    	      .text(function(d) { return d.name; })
    	      .style("fill", "white");

    	  // Set position for entering and updating nodes.
    	  g.attr("transform", function(d, i) {
    	    return "translate(" + i * (b.w + b.s)*2+ ", 0)";
    	  });

    	  // Remove exiting nodes.
    	  g.exit().remove();

    	  // Now move and update the percentage at the end.
    	  d3.select("#trail").select("#endlabel")
    	      .attr("x", (nodeArray.length + 0.5) * (b.w*2 + b.s))
    	      .attr("y", b.h / 2)
    	      .attr("dy", "0.36em")
    	      .attr("text-anchor", "middle")
    	      .text(percentageString)
    	  .style("fill", "green")

    	  // Make the breadcrumb trail visible, if it's hidden.
    	  d3.select("#trail")
    	      .style("visibility", "");

    	}