zoukankan      html  css  js  c++  java
  • Maven 导入数据库代码学习

    <!-- 初始化数据库 -->            
            <profile>
                <id>init-db</id>
                <dependencies>
                    <dependency>
                        <groupId>org.dbunit</groupId>
                        <artifactId>dbunit</artifactId>
                        <version>2.4.8</version>
                    </dependency>
                      <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi</artifactId>
                        <version>3.2-FINAL</version>
                    </dependency>
                </dependencies>
                <build>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-antrun-plugin</artifactId>
                            <version>1.7</version>
                            <configuration>
                                <target>
                                    
                                    <!-- mysql -->
                                    <property name="dbunit.datatype" value="org.dbunit.ext.mysql.MySqlDataTypeFactory" />
                                    
                                    <!-- mssql
                                    <property name="dbunit.datatype" value="org.dbunit.ext.mssql.MsSqlDataTypeFactory" /> -->
                                    
                                    <!-- oracle
                                    <property name="dbunit.datatype" value="org.dbunit.ext.oracle.Oracle10DataTypeFactory" /> -->
                                    
                                    <property file="src/main/resources/jeesite.properties" />
                                    <sql driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}" password="${jdbc.password}" 
                                        onerror="continue" encoding="${project.build.sourceEncoding}">
                                        <classpath refid="maven.test.classpath" />
                                        <transaction src="db/sys/jeesite_${jdbc.type}.sql"/>
                                        <transaction src="db/cms/jeesite_${jdbc.type}.sql"/>
                                        <transaction src="db/oa/jeesite_${jdbc.type}.sql"/>
                                        <transaction src="db/gen/jeesite_${jdbc.type}.sql"/>
                                        <transaction src="db/gen/example_${jdbc.type}.sql"/>
                                        <transaction src="db/test/jeesite_${jdbc.type}.sql"/>
                                        <transaction src="db/act/drop/activiti.${jdbc.type}.drop.engine.sql"/>
                                        <transaction src="db/act/drop/activiti.${jdbc.type}.drop.history.sql"/>
                                        <transaction src="db/act/drop/activiti.${jdbc.type}.drop.identity.sql"/>
                                        <transaction src="db/act/create/activiti.${jdbc.type}.create.engine.sql"/>
                                        <transaction src="db/act/create/activiti.${jdbc.type}.create.history.sql"/>
                                        <transaction src="db/act/create/activiti.${jdbc.type}.create.identity.sql"/>
                                    </sql>
                                    
                                    <taskdef name="dbunit" classname="org.dbunit.ant.DbUnitTask" classpathref="maven.test.classpath" />
                                    
                                    <!-- mysql、mssql -->
                                    <dbunit driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}"
                                         password="${jdbc.password}">
                                    
                                    <!-- oracle
                                    <dbunit driver="${jdbc.driver}" url="${jdbc.url}" userid="${jdbc.username}"
                                        password="${jdbc.password}" schema="${jdbc.username}" > -->
                                        
                                        <dbconfig>
                                            <property name="datatypeFactory" value="${dbunit.datatype}" />
                                        </dbconfig>
                                        <classpath refid="maven.test.classpath" />
                                        <operation type="INSERT" src="db/sys/jeesite_data.xls" format="xls" transaction="true"/>
                                        <operation type="INSERT" src="db/cms/jeesite_data.xls" format="xls" transaction="true"/>
                                        
                                    </dbunit>
                                    
                                </target>
                            </configuration>
                        </plugin>
                    </plugins>
                </build>
            </profile>
  • 相关阅读:
    【leetcode】1403. Minimum Subsequence in Non-Increasing Order
    【leetcode】1399. Count Largest Group
    【leetcode】1396. Design Underground System
    【leetcode】1395. Count Number of Teams
    【leetcode】1394. Find Lucky Integer in an Array
    【leetcode】1391. Check if There is a Valid Path in a Grid
    【leetcode】1390. Four Divisors
    【leetcode】1389. Create Target Array in the Given Order
    modelsim仿真基本流程
    Quartus调用MOdelsim仿真过程
  • 原文地址:https://www.cnblogs.com/JNUX/p/6655619.html
Copyright © 2011-2022 走看看