|
@@ -1,5 +1,6 @@
|
|
|
package org.diagbot.graph.jdbc;
|
|
|
|
|
|
+import org.diagbot.pub.utils.PropertiesUtil;
|
|
|
import org.neo4j.driver.v1.*;
|
|
|
|
|
|
import java.sql.Connection;
|
|
@@ -16,11 +17,11 @@ public class DriverManager {
|
|
|
public static int ConnPoolSize = 50;
|
|
|
public static int ConnTimeout = 2;
|
|
|
public static Driver driver = null;
|
|
|
-
|
|
|
+ public static PropertiesUtil propertiesUtil = new PropertiesUtil("bolt.properties");
|
|
|
public static Driver newDrive() throws Exception{
|
|
|
if (driver == null) {
|
|
|
// driver = GraphDatabase.driver("bolt://192.168.3.112:7687", AuthTokens.basic("neo4j", "123456"),
|
|
|
- driver = GraphDatabase.driver("bolt://192.168.2.233:7687", AuthTokens.basic("neo4j", "root"),
|
|
|
+ driver = GraphDatabase.driver(propertiesUtil.getProperty("bolt.uri"), AuthTokens.basic(propertiesUtil.getProperty("bolt.user"), propertiesUtil.getProperty("bolt.passwd")),
|
|
|
Config.build().withMaxConnectionLifetime(ConnLifeTime, TimeUnit.MINUTES)
|
|
|
.withMaxTransactionRetryTime(TransRetryTime, TimeUnit.SECONDS)
|
|
|
.withMaxConnectionPoolSize(ConnPoolSize)
|