Update of /cvsroot/csvtosql/csvtosql_jdk50/examples/test.jdbcbatchwriter
In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27295/examples/test.jdbcbatchwriter
Added Files:
create_db.sql build.xml runconsole.sh runconsole.bat mysql.jar
readme.txt
Log Message:
--- NEW FILE: build.xml ---
<!--
Created by Ivan Ryndin <a href="mailto:jj...@us...">
-->
<project name="testcvstosql" default="run">
<description>
This ant file helps to run test for next two things: ExtendedConsoleMain frontend and JdbcExtendedBatchWriter writer.
What should you do to run test:
1) Copy "cvstosql.jar" from "bin" folder to here.
2) Run ANT.
</description>
<property name="db.url" value="jdbc:mysql://localhost/testdb"/>
<property name="db.user" value="ryndin"/>
<property name="db.password" value="ryndin"/>
<property name="db.driver.class" value="com.mysql.jdbc.Driver"/>
<property name="lib.dir" value="**/../../../lib"/>
<path id="clp">
<pathelement location="mysql.jar"/>
<pathelement location="csvtosql.jar"/>
<pathelement path="..\..\lib"/>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</path>
<target name="create-db" description="Creates test database. Suitable for MySQL.">
<sql driver="${db.driver.class}" password="${db.password}" url="${db.url}" userid="${db.user}">
<classpath refid="clp" />
<transaction src="create_db.sql"/>
</sql>
</target>
<target name="run" depends="create-db" description="Run test task">
<java classname="net.sf.csv2sql.frontends.console.ExtendedConsoleMain" fork="true" classpathref="clp">
<arg line="-d data\tables.txt"/>
<syspropertyset>
<propertyref prefix="db." />
</syspropertyset>
</java>
</target>
</project>
--- NEW FILE: runconsole.sh ---
java -classpath csvtosql.jar;mysql.jar;../../lib/commons-cli-1.0.jar -Ddb.url=jdbc:mysql://localhost/testdb -Ddb.user=ryndin -Ddb.password=ryndin -Ddb.driver.class=com.mysql.jdbc.Driver net.sf.csv2sql.frontends.console.ExtendedConsoleMain $1 $2 $3 $4 $5 $6 $7 $8
--- NEW FILE: create_db.sql ---
drop database if exists testdb;
create database testdb character set 'utf8';
use testdb;
create table ADDR_TYPE (
ID integer not null auto_increment,
DELETED bit not null,
CR_TS datetime,
MOD_TS datetime,
NAME varchar(255),
CODE varchar(60),
CREATOR_ID integer,
MODIFIER_ID integer,
COMPANY_ID integer,
primary key (ID)
) type=InnoDB;
create table EFFECT (
ID integer not null auto_increment,
DELETED bit not null,
CR_TS datetime,
MOD_TS datetime,
NAME varchar(255),
CODE varchar(60),
DESCR text,
CREATOR_ID integer,
MODIFIER_ID integer,
primary key (ID)
) type=InnoDB;
create table MATRIX (
ID integer not null auto_increment,
DELETED bit not null,
CR_TS datetime,
MOD_TS datetime,
NAME varchar(255),
CODE varchar(60),
CREATOR_ID integer,
MODIFIER_ID integer,
primary key (ID)
) type=InnoDB;
create table SAMPLE_LOC (
ID integer not null auto_increment,
DELETED bit not null,
CR_TS datetime,
MOD_TS datetime,
NAME varchar(255),
CODE varchar(60),
CREATOR_ID integer,
MODIFIER_ID integer,
COMPANY_ID integer,
primary key (ID)
) type=InnoDB;
--- NEW FILE: runconsole.bat ---
java -classpath csvtosql.jar;mysql.jar;..\..\lib\commons-cli-1.0.jar -Ddb.url=jdbc:mysql://localhost/testdb -Ddb.user=ryndin -Ddb.password=ryndin -Ddb.driver.class=com.mysql.jdbc.Driver net.sf.csv2sql.frontends.console.ExtendedConsoleMain -d data\tables.txt
--- NEW FILE: mysql.jar ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: readme.txt ---
This test case does testing
of the ExtendedConsoleMain frontend
and JdbcBatchMain writer.
What should you do to run test:
1) Copy "cvstosql.jar" from "bin" folder to here.
2) Execute "create_db.sql" for creating database and its tables.
Use MySQL database. It wasn't tested on others databases. But at a glance,
all should work well on others databases. You need only to change a little
"create_db.sql" and XML descriptors in "data" folder.
3) Run either "runconsole.bat" (or "runconsole.sh") or "build.xml"
for running the task with ANT.
|