Configuration of javaDB data source

The javaDB database is a database that comes with java, which is the original derby database. It is used for testing or small applications and is completely comfortable. The most important thing is that it can be used at any time, without too much installation and configuration, you can spend more energy on core issues, which is conducive to learning and development testing. Here is an example configuration:

<?xml version="1.0" encoding="UTF-8"?>
<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="users">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>cn.jhc.bean.Employee</class>
        <properties >

            <property name="hibernate.connection.driver_class" value="org.apache.derby.jdbc.EmbeddedDriver" />
            <property name="hibernate.connection.url" value="jdbc:derby:F:\YcApp\javaDB\test;create=true;user=test;password=test" />
            <property name="hibernate.connection.password" value="test"></property>
            <property name="hibernate.connection.username" value="test"></property>
            <property name="hibernate.default_schema" value="test"></property>
            <property name="hibernate.hbm2ddl.auto" value="create" />
            <property name="hibernate.show_sql" value="true" />
            <property name="hibernate.format_sql" value="true"/>
            <property name="hibernate.hbm2ddl.import_files" value="/sql/populate.sql"/>
        </properties>
    </persistence-unit>
   

  
</persistence>
The dependencies are used here: derby.jar, in jdk\ Under db\lib, it comes with java7 and later.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326668965&siteId=291194637