Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to load data into data base using dbunit in Maven
    primarykey
    data
    text
    <p>Below is my <code>pom.xml</code> file:</p> <pre><code>&lt;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"&gt; &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt; &lt;groupId&gt;com.mycompany.app&lt;/groupId&gt; &lt;artifactId&gt;my-app&lt;/artifactId&gt; &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt; &lt;packaging&gt;jar&lt;/packaging&gt; &lt;name&gt;my-app&lt;/name&gt; &lt;url&gt;http://maven.apache.org&lt;/url&gt; &lt;properties&gt; &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt; &lt;/properties&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;junit&lt;/groupId&gt; &lt;artifactId&gt;junit&lt;/artifactId&gt; &lt;version&gt;3.8.1&lt;/version&gt; &lt;scope&gt;test&lt;/scope&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;dbunit-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.0-beta-3&lt;/version&gt; &lt;configuration&gt; &lt;driver&gt;com.mysql.jdbc.Driver&lt;/driver&gt; &lt;url&gt;jdbc:mysql://localhost:3306/test&lt;/url&gt; &lt;username&gt;usernamet&lt;/username&gt; &lt;password&gt;password&lt;/password&gt; &lt;dataTypeFactoryName&gt;org.dbunit.ext.mysql.MySqlDataTypeFactory&lt;/dataTypeFactoryName&gt; &lt;metadataHandlerName&gt;org.dbunit.ext.mysql.MySqlMetadataHandler&lt;/metadataHandlerName&gt; &lt;encoding&gt;utf-8&lt;/encoding&gt; &lt;src&gt;target/dbunit/export.xml&lt;/src&gt;&lt;!--compare 和 operation 要用到它 --&gt; &lt;type&gt;CLEAN_INSERT&lt;/type&gt;&lt;!--operation 要用到它--&gt; &lt;/configuration&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;test-compile&lt;/id&gt; &lt;phase&gt;test-compile&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;operation&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;test&lt;/id&gt; &lt;phase&gt;test&lt;/phase&gt; &lt;goals&gt; &lt;goal&gt;operation&lt;/goal&gt; &lt;/goals&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;mysql&lt;/groupId&gt; &lt;artifactId&gt;mysql-connector-java&lt;/artifactId&gt; &lt;version&gt;5.1.13&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; &lt;/project&gt; </code></pre> <p>I run mvn <code>dbunit:operation</code> on command line. </p> <pre><code>Scanning for projects... [INFO] ------------------------------------------------------------------------ [INFO] Building my-app [INFO] task-segment: [dbunit:operation] [INFO] ------------------------------------------------------------------------ [INFO] [dbunit:operation {execution: default-cli}] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 second [INFO] Finished at: Thu Feb 10 23:02:41 PST 2011 [INFO] Final Memory: 6M/81M </code></pre> <p>It says build successful. But there is no data in the database. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload