|
@@ -18,17 +18,14 @@ public class DriverManager {
|
|
public static int ConnTimeout = 2;
|
|
public static int ConnTimeout = 2;
|
|
public static Driver driver = null;
|
|
public static Driver driver = null;
|
|
public static PropertiesUtil propertiesUtil = new PropertiesUtil("bolt.properties");
|
|
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(propertiesUtil.getProperty("bolt232.uri"), AuthTokens.basic(propertiesUtil.getProperty("bolt232.user"), propertiesUtil.getProperty("bolt232.passwd")),
|
|
|
|
- Config.build().withMaxConnectionLifetime(ConnLifeTime, TimeUnit.MINUTES)
|
|
|
|
- .withMaxTransactionRetryTime(TransRetryTime, TimeUnit.SECONDS)
|
|
|
|
- .withMaxConnectionPoolSize(ConnPoolSize)
|
|
|
|
- .withConnectionAcquisitionTimeout(ConnTimeout, TimeUnit.MINUTES)
|
|
|
|
- .toConfig());
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ public static Driver newDrive() throws Exception {
|
|
|
|
+ // driver = GraphDatabase.driver("bolt://192.168.3.112:7687", AuthTokens.basic("neo4j", "123456"),
|
|
|
|
+ driver = GraphDatabase.driver(propertiesUtil.getProperty("bolt232.uri"), AuthTokens.basic(propertiesUtil.getProperty("bolt232.user"), propertiesUtil.getProperty("bolt232.passwd")),
|
|
|
|
+ Config.build().withMaxConnectionLifetime(ConnLifeTime, TimeUnit.MINUTES)
|
|
|
|
+ .withMaxTransactionRetryTime(TransRetryTime, TimeUnit.SECONDS)
|
|
|
|
+ .withMaxConnectionPoolSize(ConnPoolSize)
|
|
|
|
+ .withConnectionAcquisitionTimeout(ConnTimeout, TimeUnit.MINUTES)
|
|
|
|
+ .toConfig());
|
|
return driver;
|
|
return driver;
|
|
}
|
|
}
|
|
|
|
|