2015-10-18 17 views
0

是否有執行命令或UI以查看存儲在我的CrudRepository中的內容?我正在使用Spring創建一個服務器,您可以在運行服務器時將預先存在的用戶或數據添加到數據庫中。客戶端(android mobile)也可以添加或更新存儲庫的數據。查看CrudRepository中的內容的命令或UI

東西類似於客戶端是這樣的: http://www.coderzheaven.com/2012/01/23/working-with-sqlite-databases-through-command-line-in-android/

更新:pom.xml中的要求

<?xml version="1.0" encoding="UTF-8"?> 
<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>org.springframework</groupId> 
<artifactId>spring-rest-service-oauth</artifactId> 
<version>0.1.0</version> 
<packaging>war</packaging> 

<parent> 
    <groupId>org.springframework.boot</groupId> 
    <artifactId>spring-boot-starter-parent</artifactId> 
    <version>1.2.5.RELEASE</version> 
</parent> 

<properties> 
    <spring-security-oauth2.version>2.0.7.RELEASE</spring-security-oauth2.version> 
</properties> 

<dependencies> 
    <dependency> 
     <groupId>com.squareup.retrofit</groupId> 
     <artifactId>retrofit</artifactId> 
     <version>1.6.0</version> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-web</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-security</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-data-jpa</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.security.oauth</groupId> 
     <artifactId>spring-security-oauth2</artifactId> 
     <version>${spring-security-oauth2.version}</version> 
    </dependency> 
    <dependency> 
     <groupId>com.fasterxml.jackson.core</groupId> 
     <artifactId>jackson-databind</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.hsqldb</groupId> 
     <artifactId>hsqldb</artifactId> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-tomcat</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>org.springframework.boot</groupId> 
     <artifactId>spring-boot-starter-test</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.jayway.jsonpath</groupId> 
     <artifactId>json-path</artifactId> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.jayway.jsonpath</groupId> 
     <artifactId>json-path-assert</artifactId> 
     <version>0.9.1</version> 
     <scope>test</scope> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.springframework.boot</groupId> 
      <artifactId>spring-boot-maven-plugin</artifactId> 
     </plugin> 
    </plugins> 
</build> 

<repositories> 
    <repository> 
     <id>spring-releases</id> 
     <url>https://repo.spring.io/libs-release</url> 
    </repository> 
</repositories> 

<pluginRepositories> 
    <pluginRepository> 
     <id>spring-plugin-releases</id> 
     <url>https://repo.spring.io/plugins-release</url> 
    </pluginRepository> 
</pluginRepositories> 

+0

您正在使用什麼數據庫?許多數據庫都有可視化/訪問/編輯存儲數據的工具。 – ESala

+0

@Darkean CrudRepository Spring數據JPA – yeeen

+0

是的,但哪個數據庫? MySQL的? Postgre? Spring Data數據庫由數據庫支持。如果您不知道我在說什麼,那麼您可能使用的是默認的內存數據庫,如H2。如果你在你的'pom.xml'中提供了依賴關係會很有幫助。 – ESala

回答

0

正如你可以在你的pom.xml您正在使用HSQLDB看這是一個最有可能運行內存的嵌入式數據庫,由Spring Boot應用程序自動啓動和管理。

您可以使用HSQL數據庫管理器 GUI可視化數據庫的內容。

在這裏看到一個如何引導:View content of HSQLDB embedded database