/*
* Copyright (c) 2016 LARUS Business Automation [http://www.larus-ba.it]
*
* This file is part of the "LARUS Integration Framework for Neo4j".
*
* The "LARUS Integration Framework for Neo4j" is licensed 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.
*
* Created on 15/4/2016
*/
package org.neo4j.jdbc.http;
import org.neo4j.jdbc.*;
import org.neo4j.jdbc.http.driver.CypherExecutor;
import org.neo4j.jdbc.http.driver.Neo4jResponse;
import org.neo4j.jdbc.http.driver.Neo4jStatement;
import org.neo4j.jdbc.impl.Neo4jConnectionImpl;
import org.neo4j.jdbc.utils.ExceptionBuilder;
import org.neo4j.jdbc.utils.Neo4jJdbcRuntimeException;
import org.neo4j.jdbc.utils.TimeLimitedCodeBlock;
import java.sql.CallableStatement;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.concurrent.TimeUnit;
public class HttpNeo4jConnection extends Neo4jConnectionImpl implements Loggable {
CypherExecutor executor;
private boolean isClosed = false;
private boolean debug = false;
private int debugLevel;
/**
* Default constructor.
*
* @param host Hostname of the Neo4j instance.
* @param port HTTP port of the Neo4j instance.
* @param secure Secure
* @param properties Properties of the url connection.
* @param url Url
* @throws SQLException sqlexption
*/
public HttpNeo4jConnection(String host, Integer port, Boolean secure, Properties properties, String url) throws SQLException {
super(properties, url, Neo4jResultSet.CLOSE_CURSORS_AT_COMMIT);
this.executor = new CypherExecutor(host, port, secure, properties);
}
/**
* Execute a cypher query.
*
* @param queries List of cypher queries
* @param parameters Parameter of the cypher queries (match by index)
* @param stats Do we need to include stats ?
* @return ...
* @throws SQLException sqlexception
*/
public Neo4jResponse executeQueries(final List queries, List