本文介绍了ArangoDB Java API创建数据库无法在3.1.RC3中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经安装了ArangoDB 3.1 RC3社区版,并使用以下代码创建了maven项目
I have installed ArangoDB 3.1 RC3 community edition and created maven project with below code
ArangoDB arangoDB = new ArangoDB.Builder().host("127.0.0.1").port(8529).build();
String dbName = "mydb";
try {
arangoDB.createDatabase(dbName);
System.out.println("Database created: " + dbName);
} catch (ArangoDBException e) {
System.err.println("Failed to create database: " + dbName + "; " + e.getMessage());
}
这是我的pom.xml
Here is my pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mydb</groupId>
<artifactId>ArangodbTest</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>ArangodbTest</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
</dependency>
<dependency>
<groupId>com.arangodb</groupId>
<artifactId>arangodb-java-driver</artifactId>
<version>4.0.0</version>
</dependency>
</dependencies>
</project>
数据库不是在ArangoDB中创建的,不会引发任何异常,它会继续运行..
Database is not created in ArangoDB and no exceptions are thrown, its keep on running..
我也尝试使用arangodb-java-driver 4.0.0和4.1.0,但仍然无法正常工作
I have tried with arangodb-java-driver 4.0.0 and 4.1.0 as well, but still not working
帮我解决这个问题
预先感谢
推荐答案
我认为您丢失了一些代码.试试这个:
I think you lost some code. Try this :
这篇关于ArangoDB Java API创建数据库无法在3.1.RC3中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!