Как изменить имя пользователя и пароль по умолчанию для базы данных h2? - PullRequest
0 голосов
/ 14 июня 2019

Я просыпаюсь с режимом сервера базы данных H2, maven и hibernate. Как всем известно, в hibernate есть пользователь по умолчанию "sa" и пароль по умолчанию "". Есть ли способ изменить имя пользователя и пароль по умолчанию? Я оставляю файл persistence.xml, который настраивает hibernate и jdbc

<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence

http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"

  version="2.1">

  <persistence-unit name="persistenceUnit">
    <class>com.luis.dominio.Persona</class>
    <properties>
      <!-- Configuring JDBC properties -->
      <property name="javax.persistence.jdbc.url" value="jdbc:h2:tcp://localhost:9092/~/test;PASSWORD_HASH=TRUE" />
      <property name="javax.persistence.jdbc.user" value="sa" />
      <property name="javax.persistence.jdbc.password" value="" />
      <property name="javax.persistence.jdbc.driver" value="org.h2.Driver" />
      <property name="javax.persistence.schema-generation.database.action" value="update"/> 

      <!-- Hibernate properties -->
      <property name="hibernate.show_sql" value="true" />
      <property name="hibernate.format_sql" value="true" />
      <property name="hibernate.dialect" value="org.hibernate.dialect.H2Dialect" />
      <property name="hibernate.hbm2ddl.auto" value="update" />
    </properties> 
  </persistence-unit>
</persistence>

Я ценю любую помощь

...