csvtosql-cvs Mailing List for csvtosql (Page 3)
Brought to you by:
davideconsonni
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(3) |
Apr
(106) |
May
(3) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(73) |
Nov
(20) |
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(7) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vano <jj...@us...> - 2006-10-13 09:15:14
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22536/src/net/sf/csv2sql/grammars/mysql Modified Files: MysqlFieldBigint.java MysqlFieldChar.java MysqlFieldFloat.java MysqlFieldSmallint.java MysqlFieldDouble.java MysqlFieldMediumint.java MysqlFieldDate.java MysqlFieldInt.java MysqlFieldBit.java MysqlFieldTinyint.java Log Message: added next feature: if fields equals ignore case "null", then we get database NULL Index: MysqlFieldSmallint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldSmallint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldSmallint.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldSmallint.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldTinyint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldTinyint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldTinyint.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldTinyint.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldInt.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldInt.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldInt.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldInt.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 49,52 **** --- 49,53 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} long result = Long.parseLong(strValue.trim()); Index: MysqlFieldMediumint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldMediumint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldMediumint.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldMediumint.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldDate.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldDate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldDate.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldDate.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); Index: MysqlFieldBigint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldBigint.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldBigint.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldBigint.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 46,49 **** --- 46,50 ---- try { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} //get value Index: MysqlFieldBit.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldBit.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldBit.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldBit.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 45,48 **** --- 45,49 ---- try { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} //get value Index: MysqlFieldFloat.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldFloat.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldFloat.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldFloat.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- //get value + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String strValue = ((String)value).replaceAll(",", "."); long result = Long.parseLong(strValue.trim()); Index: MysqlFieldChar.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldChar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldChar.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldChar.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 44,48 **** try { ! //get value String strValue = ((String)value); --- 44,48 ---- try { ! if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} //get value String strValue = ((String)value); Index: MysqlFieldDouble.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/mysql/MysqlFieldDouble.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** MysqlFieldDouble.java 11 Oct 2006 18:23:18 -0000 1.2 --- MysqlFieldDouble.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,51 **** --- 48,52 ---- //get value + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String strValue = ((String)value).replaceAll(",", "."); float result = Float.parseFloat(strValue.trim()); |
From: Vano <jj...@us...> - 2006-10-13 09:15:14
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/db2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22536/src/net/sf/csv2sql/grammars/db2 Modified Files: DB2DateField.java DB2FloatField.java DB2IntegerField.java DB2StringField.java Log Message: added next feature: if fields equals ignore case "null", then we get database NULL Index: DB2FloatField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/db2/DB2FloatField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2FloatField.java 11 Oct 2006 18:23:18 -0000 1.2 --- DB2FloatField.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 43,46 **** --- 43,47 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String strFloat = ((String)value).replaceAll(",", "."); result = String.valueOf(new Float(Float.parseFloat(strFloat))); Index: DB2IntegerField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/db2/DB2IntegerField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2IntegerField.java 11 Oct 2006 18:23:18 -0000 1.2 --- DB2IntegerField.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 43,46 **** --- 43,47 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} result = String.valueOf(new Integer(Integer.parseInt((String)value)).intValue()); } Index: DB2StringField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/db2/DB2StringField.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** DB2StringField.java 25 Apr 2005 10:53:13 -0000 1.1 --- DB2StringField.java 13 Oct 2006 09:15:09 -0000 1.2 *************** *** 46,49 **** --- 46,50 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} value = this.truncateValue(value); value = this.escapeValue(value); Index: DB2DateField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/db2/DB2DateField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2DateField.java 11 Oct 2006 18:23:18 -0000 1.2 --- DB2DateField.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 48,52 **** result = getDefaulNullValue(); } else { ! String inputFormat = this.getFieldProperties().getProperty("inputformat"); --- 48,52 ---- result = getDefaulNullValue(); } else { ! if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); |
From: Vano <jj...@us...> - 2006-10-13 09:15:14
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/oracle In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22536/src/net/sf/csv2sql/grammars/oracle Modified Files: OracleFieldNumber.java OracleFieldDate.java OracleFieldVarchar.java Log Message: added next feature: if fields equals ignore case "null", then we get database NULL Index: OracleFieldDate.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/oracle/OracleFieldDate.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleFieldDate.java 11 Oct 2006 18:23:18 -0000 1.2 --- OracleFieldDate.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 49,52 **** --- 49,53 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); Index: OracleFieldVarchar.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/oracle/OracleFieldVarchar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleFieldVarchar.java 11 Oct 2006 18:23:18 -0000 1.2 --- OracleFieldVarchar.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 44,48 **** try { ! //get value String strValue = ((String)value); --- 44,48 ---- try { ! if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} //get value String strValue = ((String)value); Index: OracleFieldNumber.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/grammars/oracle/OracleFieldNumber.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** OracleFieldNumber.java 11 Oct 2006 18:23:18 -0000 1.2 --- OracleFieldNumber.java 13 Oct 2006 09:15:09 -0000 1.3 *************** *** 43,46 **** --- 43,47 ---- try { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} //get value |
From: Vano <jj...@us...> - 2006-10-13 09:09:45
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20348/src/net/sf/csv2sql/writers Modified Files: JdbcWriter.java Log Message: Index: JdbcWriter.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers/JdbcWriter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** JdbcWriter.java 11 Oct 2006 18:23:20 -0000 1.3 --- JdbcWriter.java 13 Oct 2006 09:09:42 -0000 1.4 *************** *** 130,133 **** return hm; } - } --- 130,132 ---- |
From: Vano <jj...@us...> - 2006-10-13 09:09:36
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv20341/src/net/sf/csv2sql/writers Added Files: JdbcExtendedBatchWriter.java Log Message: --- NEW FILE: JdbcExtendedBatchWriter.java --- /* Copyright (C) 2006 Ivan Ryndin <jj...@us...> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ package net.sf.csv2sql.writers; import java.io.File; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import net.sf.csv2sql.storage.exceptions.StorageException; import net.sf.csv2sql.utils.DBUtils; import net.sf.csv2sql.writers.exceptions.InvalidParameterValueException; import net.sf.csv2sql.writers.exceptions.WriterException; /** * Load generated statements in a jdbc resource with batch method. * Use given connection. After having commit done doesn't close * connection. This is convinient when importing data from several files * one after another into the same database. Doesn't waste time for open and close * connection after each file data processed. * @see * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> * @version $Revision: 1.1 $, $Date: 2006/10/13, Friday :-) * @since 3.0 */ public class JdbcExtendedBatchWriter extends AbstractWriter { int batchCount; int commitBatchCount; private void init() throws InvalidParameterValueException { batchCount = Integer.parseInt(getWriterProperties().getProperty("batchcount", "10")); //optional commitBatchCount = Integer.parseInt(getWriterProperties().getProperty("commitbatchcount", "0")); } /** * @see AbstractWriter#write */ public void write() throws WriterException{ //get configuration options init(); String currentSQL = null; int sqlIndex = 0; try { HashMap<String, Object> params = getWriterParameters(); if (params == null) throw new WriterException("Cannot get writer parameters! Returned HashMap is null"); Connection connection = (Connection)params.get("connection"); if (connection==null) throw new WriterException("Cannot get not-null connection! Set please connection to database in writer parameters"); Statement stmt = connection.createStatement(); try { //start transaction if (commitBatchCount != 1) { connection.setAutoCommit(false); } int batchSize = 0; int commitIdx = 0; for (int i=0; i<getStorage().size(); i++) { String sql = getStorage().get(i); stmt.addBatch(sql); sqlIndex++; currentSQL = sql; if (++batchSize == batchCount) { batchSize = 0; stmt.executeBatch(); if (commitBatchCount > 1 && commitBatchCount == ++commitIdx) { connection.commit(); commitIdx = 0; } stmt.clearBatch(); } } // take care of the remaining records. stmt.executeBatch(); stmt.clearBatch(); //stop transaction if (commitBatchCount != 1) { connection.commit(); } } finally { stmt.close(); } } catch (StorageException e) { throw new WriterException("cannot read data from temporary storage", e); } catch (SQLException e) { throw new WriterException("cannot write statement to database: " + sqlIndex + "\n" + e.getMessage() + "\n" + currentSQL, e); } } protected HashMap<String,String> requiredParameterList() { HashMap<String,String> hm = new HashMap<String,String>(); hm.put("commitbatchcount","commitbatchcount."); return hm; } protected HashMap<String,String> optionalParameterList() { HashMap<String,String> hm = new HashMap<String,String>(); hm.put("batchcount","batchcount."); return hm; } } |
From: Vano <jj...@us...> - 2006-10-13 09:03:54
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers/exceptions In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv18190/src/net/sf/csv2sql/writers/exceptions Modified Files: WriterException.java Log Message: added one more constructor for convinience Index: WriterException.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers/exceptions/WriterException.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** WriterException.java 11 Oct 2006 18:23:20 -0000 1.2 --- WriterException.java 13 Oct 2006 09:03:51 -0000 1.3 *************** *** 33,36 **** super(cause); } ! } --- 33,43 ---- super(cause); } ! ! /** ! * Added for convinience. ! * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> ! */ ! public WriterException(String message) { ! super(message); ! } } |
From: Vano <jj...@us...> - 2006-10-13 09:01:56
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv17439/src/net/sf/csv2sql/writers Modified Files: AbstractWriter.java Log Message: get/set parameter methods added Index: AbstractWriter.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/src/net/sf/csv2sql/writers/AbstractWriter.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** AbstractWriter.java 11 Oct 2006 18:23:20 -0000 1.3 --- AbstractWriter.java 13 Oct 2006 09:01:50 -0000 1.4 *************** *** 47,50 **** --- 47,57 ---- /** + * Writer parameters. + * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> + */ + private HashMap<String, Object> parameters = null; + + + /** * write list of statements. * @throws WriterException if data could not be written (for any reason) *************** *** 104,108 **** protected abstract HashMap<String, String> requiredParameterList(); ! protected abstract HashMap<String, String> optionalParameterList(); } --- 111,134 ---- protected abstract HashMap<String, String> requiredParameterList(); ! protected abstract HashMap<String, String> optionalParameterList(); ! ! /** ! * This is used for setting of any required Parameters for writer ! * @param parameters java.util.HashMap containing writer parameters. Keys are parameter ! * identifiers, and appropriate values are parameters itself. ! * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> ! */ ! public void setWriterParameters(HashMap<String, Object> parameters) { ! this.parameters = parameters; ! } ! ! /** ! * This is used for getting of any required Parameters for writer ! * @return Parameters of the writer. Can be null. ! * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> ! */ ! public HashMap<String, Object> getWriterParameters() { ! return parameters; ! } } |
From: Vano <jj...@us...> - 2006-10-12 15:46:08
|
Update of /cvsroot/csvtosql/csvtosql In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28368 Added Files: .cvsignore Log Message: --- NEW FILE: .cvsignore --- classes |
From: Vano <jj...@us...> - 2006-10-12 15:43:35
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/frontends/console In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27591/src/net/sf/csv2sql/frontends/console Modified Files: ExtendedConsoleMain.java Log Message: Index: ExtendedConsoleMain.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/frontends/console/ExtendedConsoleMain.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ExtendedConsoleMain.java 12 Oct 2006 10:42:32 -0000 1.1 --- ExtendedConsoleMain.java 12 Oct 2006 15:43:31 -0000 1.2 *************** *** 164,170 **** for (int i=0; i<files.size(); i++) { String fileName = pathPart + (String)files.get(i); ! System.out.println("Processing file: " + fileName); File descriptor = new File(fileName); ExtendedConsoleMain.getInstance().run(descriptor,connection); } System.out.println("\nCsv converted in: "+String.valueOf(System.currentTimeMillis()-start)+" ms"); --- 164,171 ---- for (int i=0; i<files.size(); i++) { String fileName = pathPart + (String)files.get(i); ! System.out.print("Processing file: " + fileName); File descriptor = new File(fileName); ExtendedConsoleMain.getInstance().run(descriptor,connection); + System.out.println(" ............ OK"); } System.out.println("\nCsv converted in: "+String.valueOf(System.currentTimeMillis()-start)+" ms"); |
From: Vano <jj...@us...> - 2006-10-12 15:43:31
|
Update of /cvsroot/csvtosql/csvtosql/examples/test.extended.features/data In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27215/examples/test.extended.features/data Added Files: sample_loc.xml effect.xml matrix.xml tables.txt effect.csv addr_type.xml sample_loc.csv addr_type.csv matrix.csv Log Message: new files for test case for extended features --- NEW FILE: matrix.csv --- ID,DELETED,CR_TS,MOD_TS,NAME,CODE,CREATOR_ID,MODIFIER_ID "1","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Soil","SOIL",NULL,NULL "2","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Air","AIR",NULL,NULL "3","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Water","WATER",NULL,NULL --- NEW FILE: effect.xml --- <?xml version="1.0" encoding="UTF-8"?> <root> <!-- CONFIGURATOR DATA --> <descriptor version="2"/> <!-- DEFINE HERE TABLE STRUCTURE --> <structure tablename="effect"> <field name="ID" type="INT"/> <field name="DELETED" type="BOOL"/> <field name="CR_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="MOD_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="NAME" type="VARCHAR"/> <field name="CODE" type="VARCHAR"/> <field name="DESCR" type="VARCHAR"/> <field name="CREATOR_ID" type="INT"/> <field name="MODIFIER_ID" type="INT"/> </structure> <!-- WHAT GRAMMAR USE --> <grammar class="net.sf.csv2sql.grammars.mysql.GrammarFactory"/> <!-- TEMPORARY STORAGE --> <storage class="net.sf.csv2sql.storage.Memory"/> <!-- RENDERER CONFIGURATION --> <render class="net.sf.csv2sql.renders.SqlInsertRenderer"> <param name="inputfile" value="effect.csv"/> <param name="separator" value=","/> <!--optional--> <param name="trimdata" value="true"/> <param name="removedoublequotes" value="true"/> <param name="skiplines" value="1"/> <param name="splitter" value="net.sf.csv2sql.renders.splitters.Standard"/> </render> <!-- WRITER CONFIGURATION --> <output> <writerAppender active="true" class="net.sf.csv2sql.writers.JdbcExtendedBatchWriter"> <param name="batchcount" value="0"/> <param name="commitbatchcount" value="0"/> </writerAppender> <writerAppender active="false" class="net.sf.csv2sql.writers.SqlFileWriter"> <param name="filename" value="effect.sql"/> </writerAppender> </output> </root> --- NEW FILE: addr_type.xml --- <?xml version="1.0" encoding="UTF-8"?> <root> <!-- CONFIGURATOR DATA --> <descriptor version="2"/> <!-- DEFINE HERE TABLE STRUCTURE --> <structure tablename="addr_type"> <field name="ID" type="INT"/> <field name="DELETED" type="BOOL"/> <field name="CR_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="MOD_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="NAME" type="VARCHAR"/> <field name="CODE" type="VARCHAR"/> <field name="CREATOR_ID" type="INT"/> <field name="MODIFIER_ID" type="INT"/> <field name="COMPANY_ID" type="INT"/> </structure> <!-- WHAT GRAMMAR USE --> <grammar class="net.sf.csv2sql.grammars.mysql.GrammarFactory"/> <!-- TEMPORARY STORAGE --> <storage class="net.sf.csv2sql.storage.Memory"/> <!-- RENDERER CONFIGURATION --> <render class="net.sf.csv2sql.renders.SqlInsertRenderer"> <param name="inputfile" value="addr_type.csv"/> <param name="separator" value=","/> <!--optional--> <param name="trimdata" value="true"/> <param name="removedoublequotes" value="true"/> <param name="skiplines" value="1"/> <param name="splitter" value="net.sf.csv2sql.renders.splitters.Standard"/> </render> <!-- WRITER CONFIGURATION --> <output> <writerAppender active="true" class="net.sf.csv2sql.writers.JdbcExtendedBatchWriter"> <param name="batchcount" value="0"/> <param name="commitbatchcount" value="0"/> </writerAppender> <writerAppender active="false" class="net.sf.csv2sql.writers.SqlFileWriter"> <param name="filename" value="addr_type.sql"/> </writerAppender> </output> </root> --- NEW FILE: effect.csv --- ID,DELETED,CR_TS,MOD_TS,NAME,CODE,DESCR,CREATOR_ID,MODIFIER_ID "1","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Allergic dermatitis",NULL,"Allergic dermatitis",NULL,NULL "2","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Anemia; decrease in blood platelets; increased risk of cancer",NULL,"Anemia; decrease in blood platelets; increased risk of cancer",NULL,NULL "3","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Anemia; infants & young children: nervous system effects",NULL,"Anemia; infants & young children: nervous system effects",NULL,NULL "4","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Anemia; liver, kidney or spleen damage; changes in blood",NULL,"Anemia; liver, kidney or spleen damage; changes in blood",NULL,NULL "5","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Bone disease (pain and tenderness of the bones); Children may get mottled teeth",NULL,"Bone disease (pain and tenderness of the bones); Children may get mottled teeth",NULL,NULL "6","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Cardiovascular system or reproductive problems",NULL,"Cardiovascular system or reproductive problems",NULL,NULL "7","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Cataracts",NULL,"Cataracts",NULL,NULL "8","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Changes in adrenal glands",NULL,"Changes in adrenal glands",NULL,NULL "9","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Eye, liver, kidney or spleen problems; anemia; increased risk of cancer",NULL,"Eye, liver, kidney or spleen problems; anemia; increased risk of cancer",NULL,NULL "10","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Eye/nose irritation; stomach discomfort",NULL,"Eye/nose irritation; stomach discomfort",NULL,NULL "11","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Eye/nose irritation; stomach discomfort, anemia",NULL,"Eye/nose irritation; stomach discomfort, anemia",NULL,NULL "12","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Gastrointestinal illness (e.g., diarrhea, vomiting, cramps)",NULL,"Gastrointestinal illness (e.g., diarrhea, vomiting, cramps)",NULL,NULL "13","0","2006-10-10 14:29:48","2006-10-10 14:29:48","HPC has no health effects; it is an analytic method used to measure the variety of bacteria that are common in water. The lower the concentration of bacteria in drinking water, the better maintained the water system is.",NULL,"HPC has no health effects; it is an analytic method used to measure the variety of bacteria that are common in water. The lower the concentration of bacteria in drinking water, the better maintained the water system is.",NULL,NULL "14","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Hair loss; changes in blood; kidney, intestine, or liver problems",NULL,"Hair loss; changes in blood; kidney, intestine, or liver problems",NULL,NULL "15","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Hair or fingernail loss; numbness in fingers or toes; circulatory problems",NULL,"Hair or fingernail loss; numbness in fingers or toes; circulatory problems",NULL,NULL "16","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increase in blood cholesterol; decrease in blood sugar",NULL,"Increase in blood cholesterol; decrease in blood sugar",NULL,NULL "17","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increase in blood pressure",NULL,"Increase in blood pressure",NULL,NULL "18","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increased cancer risk, and over a long period of time, stomach problems",NULL,"Increased cancer risk, and over a long period of time, stomach problems",NULL,NULL "19","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increased risk of cancer",NULL,"Increased risk of cancer",NULL,NULL "20","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increased risk of cancer, kidney toxicity",NULL,"Increased risk of cancer, kidney toxicity",NULL,NULL "21","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Increased risk of developing benign intestinal polyps",NULL,"Increased risk of developing benign intestinal polyps",NULL,NULL "22","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Infants and children: Delays in physical or mental development; children could show slight deficits in attention span and learning abilities; Adults: Kidney problems; high blood pressure",NULL,"Infants and children: Delays in physical or mental development; children could show slight deficits in attention span and learning abilities; Adults: Kidney problems; high blood pressure",NULL,NULL "23","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Infants below the age of six months who drink water containing nitrate in excess of the MCL could become seriously ill and, if untreated, may die. Symptoms include shortness of breath and blue-baby syndrome.",NULL,"Infants below the age of six months who drink water containing nitrate in excess of the MCL could become seriously ill and, if untreated, may die. Symptoms include shortness of breath and blue-baby syndrome.",NULL,NULL "24","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Infants below the age of six months who drink water containing nitrite in excess of the MCL could become seriously ill and, if untreated, may die. Symptoms include shortness of breath and blue-baby syndrome.",NULL,"Infants below the age of six months who drink water containing nitrite in excess of the MCL could become seriously ill and, if untreated, may die. Symptoms include shortness of breath and blue-baby syndrome.",NULL,NULL "25","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Intestinal lesions",NULL,"Intestinal lesions",NULL,NULL "26","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Kidney damage",NULL,"Kidney damage",NULL,NULL "27","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Kidney or stomach problems",NULL,"Kidney or stomach problems",NULL,NULL "28","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Kidney problems; reproductive difficulties",NULL,"Kidney problems; reproductive difficulties",NULL,NULL "29","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Kidney, liver, or adrenal gland problems",NULL,"Kidney, liver, or adrenal gland problems",NULL,NULL "30","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Kidney, liver, or thyroid problems; increased risk of cancer",NULL,"Kidney, liver, or thyroid problems; increased risk of cancer",NULL,NULL "31","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Legionnaire's Disease, a type of pneumonia",NULL,"Legionnaire's Disease, a type of pneumonia",NULL,NULL "32","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver damage; increased risk of cancer",NULL,"Liver damage; increased risk of cancer",NULL,NULL "33","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver or kidney problems",NULL,"Liver or kidney problems",NULL,NULL "34","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver or kidney problems; increased cancer risk",NULL,"Liver or kidney problems; increased cancer risk",NULL,NULL "35","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver or kidney problems; reproductive difficulties; increased risk of cancer",NULL,"Liver or kidney problems; reproductive difficulties; increased risk of cancer",NULL,NULL "36","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver or kidneys problems",NULL,"Liver or kidneys problems",NULL,NULL "37","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver or nervous system problems; increased risk of cancer",NULL,"Liver or nervous system problems; increased risk of cancer",NULL,NULL "38","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver problems",NULL,"Liver problems",NULL,NULL "39","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver problems; increased risk of cancer",NULL,"Liver problems; increased risk of cancer",NULL,NULL "40","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver, kidney or central nervous system problems; increased risk of cancer",NULL,"Liver, kidney or central nervous system problems; increased risk of cancer",NULL,NULL "41","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver, kidney, or circulatory system problems",NULL,"Liver, kidney, or circulatory system problems",NULL,NULL "42","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver, kidney, or immune system problems",NULL,"Liver, kidney, or immune system problems",NULL,NULL "43","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Liver, nervous system, or circulatory problems",NULL,"Liver, nervous system, or circulatory problems",NULL,NULL "44","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Minor kidney changes",NULL,"Minor kidney changes",NULL,NULL "45","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Nerve damage or thyroid problems",NULL,"Nerve damage or thyroid problems",NULL,NULL "46","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Nervous system damage",NULL,"Nervous system damage",NULL,NULL "47","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Nervous system or blood problems; increased risk of cancer",NULL,"Nervous system or blood problems; increased risk of cancer",NULL,NULL "48","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Nervous system, kidney, or liver problems",NULL,"Nervous system, kidney, or liver problems",NULL,NULL "49","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Not a health threat in itself; it is used to indicate whether other potentially harmful bacteria may be present",NULL,"Not a health threat in itself; it is used to indicate whether other potentially harmful bacteria may be present",NULL,NULL "50","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Problems with blood",NULL,"Problems with blood",NULL,NULL "51","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Problems with blood, nervous system, or reproductive system",NULL,"Problems with blood, nervous system, or reproductive system",NULL,NULL "52","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Problems with liver, stomach, reproductive system, or kidneys; increased risk of cancer",NULL,"Problems with liver, stomach, reproductive system, or kidneys; increased risk of cancer",NULL,NULL "53","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Reproductive difficulties",NULL,"Reproductive difficulties",NULL,NULL "54","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Reproductive difficulties; increased risk of cancer",NULL,"Reproductive difficulties; increased risk of cancer",NULL,NULL "55","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Reproductive difficulties; liver problems; increased risk of cancer",NULL,"Reproductive difficulties; liver problems; increased risk of cancer",NULL,NULL "56","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Short term exposure: Gastrointestinal distress; Long term exposure: Liver or kidney damage; People with Wilson's Disease should consult their personal doctor if the amount of copper in their water exceeds the action level",NULL,"Short term exposure: Gastrointestinal distress; Long term exposure: Liver or kidney damage; People with Wilson's Disease should consult their personal doctor if the amount of copper in their water exceeds the action level",NULL,NULL "57","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Skin changes; thymus gland problems; immune deficiencies; reproductive or nervous system difficulties; increased risk of cancer",NULL,"Skin changes; thymus gland problems; immune deficiencies; reproductive or nervous system difficulties; increased risk of cancer",NULL,NULL "58","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Skin damage or problems with circulatory systems, and may have increased risk of getting cancer",NULL,"Skin damage or problems with circulatory systems, and may have increased risk of getting cancer",NULL,NULL "59","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Slight nervous system effects",NULL,"Slight nervous system effects",NULL,NULL "60","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Stomach and intestinal problems",NULL,"Stomach and intestinal problems",NULL,NULL "61","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Tooth discoloration",NULL,"Tooth discoloration",NULL,NULL "62","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Turbidity is a measure of the cloudiness of water. It is used to indicate water quality and filtration effectiveness (e.g., whether disease-causing organisms are present). Higher turbidity levels are often associated with higher levels of disease-causing",NULL,"Turbidity is a measure of the cloudiness of water. It is used to indicate water quality and filtration effectiveness (e.g., whether disease-causing organisms are present). Higher turbidity levels are often associated with higher levels of disease-causing ",NULL,NULL "63","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Weight loss, liver problems, or possible reproductive difficulties.",NULL,"Weight loss, liver problems, or possible reproductive difficulties.",NULL,NULL "64","0","2006-10-10 14:29:48","2006-10-10 14:29:48","black to brown color; black staining; bitter metallic taste",NULL,"black to brown color; black staining; bitter metallic taste",NULL,NULL "65","0","2006-10-10 14:29:48","2006-10-10 14:29:48","colored water",NULL,"colored water",NULL,NULL "66","0","2006-10-10 14:29:48","2006-10-10 14:29:48","frothy, cloudy; bitter taste; odor",NULL,"frothy, cloudy; bitter taste; odor",NULL,NULL "67","0","2006-10-10 14:29:48","2006-10-10 14:29:48","hardness; deposits; colored water; staining; salty taste",NULL,"hardness; deposits; colored water; staining; salty taste",NULL,NULL "68","0","2006-10-10 14:29:48","2006-10-10 14:29:48","high pH: slippery feel; soda taste; deposits",NULL,"high pH: slippery feel; soda taste; deposits",NULL,NULL "69","0","2006-10-10 14:29:48","2006-10-10 14:29:48","low pH: bitter metallic taste; corrosion ",NULL,"low pH: bitter metallic taste; corrosion ",NULL,NULL "70","0","2006-10-10 14:29:48","2006-10-10 14:29:48","metallic taste",NULL,"metallic taste",NULL,NULL "71","0","2006-10-10 14:29:48","2006-10-10 14:29:48","metallic taste; blue-green staining",NULL,"metallic taste; blue-green staining",NULL,NULL "72","0","2006-10-10 14:29:48","2006-10-10 14:29:48","metallic taste; corroded pipes/ fixtures staining",NULL,"metallic taste; corroded pipes/ fixtures staining",NULL,NULL "73","0","2006-10-10 14:29:48","2006-10-10 14:29:48","rotten-egg, musty or chemical smell",NULL,"rotten-egg, musty or chemical smell",NULL,NULL "74","0","2006-10-10 14:29:48","2006-10-10 14:29:48","rusty color; sediment; metallic taste; reddish or orange staining",NULL,"rusty color; sediment; metallic taste; reddish or orange staining",NULL,NULL "75","0","2006-10-10 14:29:48","2006-10-10 14:29:48","salty taste",NULL,"salty taste",NULL,NULL "76","0","2006-10-10 14:29:48","2006-10-10 14:29:48","skin discoloration; graying of the white part of the eye",NULL,"skin discoloration; graying of the white part of the eye",NULL,NULL "77","0","2006-10-10 14:29:48","2006-10-10 14:29:48","visible tint",NULL,"visible tint",NULL,NULL --- NEW FILE: matrix.xml --- <?xml version="1.0" encoding="UTF-8"?> <root> <!-- CONFIGURATOR DATA --> <descriptor version="2"/> <!-- DEFINE HERE TABLE STRUCTURE --> <structure tablename="matrix"> <field name="ID" type="INT"/> <field name="DELETED" type="BOOL"/> <field name="CR_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="MOD_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="NAME" type="VARCHAR"/> <field name="CODE" type="VARCHAR"/> <field name="CREATOR_ID" type="INT"/> <field name="MODIFIER_ID" type="INT"/> </structure> <!-- WHAT GRAMMAR USE --> <grammar class="net.sf.csv2sql.grammars.mysql.GrammarFactory"/> <!-- TEMPORARY STORAGE --> <storage class="net.sf.csv2sql.storage.Memory"/> <!-- RENDERER CONFIGURATION --> <render class="net.sf.csv2sql.renders.SqlInsertRenderer"> <param name="inputfile" value="matrix.csv"/> <param name="separator" value=","/> <!--optional--> <param name="trimdata" value="true"/> <param name="removedoublequotes" value="true"/> <param name="skiplines" value="1"/> <param name="splitter" value="net.sf.csv2sql.renders.splitters.Standard"/> </render> <!-- WRITER CONFIGURATION --> <output> <writerAppender active="true" class="net.sf.csv2sql.writers.JdbcExtendedBatchWriter"> <param name="batchcount" value="0"/> <param name="commitbatchcount" value="0"/> </writerAppender> <writerAppender active="false" class="net.sf.csv2sql.writers.SqlFileWriter"> <param name="filename" value="matrix.sql"/> </writerAppender> </output> </root> --- NEW FILE: sample_loc.xml --- <?xml version="1.0" encoding="UTF-8"?> <root> <!-- CONFIGURATOR DATA --> <descriptor version="2"/> <!-- DEFINE HERE TABLE STRUCTURE --> <structure tablename="sample_loc"> <field name="ID" type="INT"/> <field name="DELETED" type="BOOL"/> <field name="CR_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="MOD_TS" type="DATE"> <param name="inputformat" value="yyyy-MM-dd hh:mm:ss"/> <param name="outputformat" value="yyyy-MM-dd hh:mm:ss"/> </field> <field name="NAME" type="VARCHAR"/> <field name="CODE" type="VARCHAR"/> <field name="CREATOR_ID" type="INT"/> <field name="MODIFIER_ID" type="INT"/> <field name="COMPANY_ID" type="INT"/> </structure> <!-- WHAT GRAMMAR USE --> <grammar class="net.sf.csv2sql.grammars.mysql.GrammarFactory"/> <!-- TEMPORARY STORAGE --> <storage class="net.sf.csv2sql.storage.Memory"/> <!-- RENDERER CONFIGURATION --> <render class="net.sf.csv2sql.renders.SqlInsertRenderer"> <param name="inputfile" value="sample_loc.csv"/> <param name="separator" value=","/> <!--optional--> <param name="trimdata" value="true"/> <param name="removedoublequotes" value="true"/> <param name="skiplines" value="1"/> <param name="splitter" value="net.sf.csv2sql.renders.splitters.Standard"/> </render> <!-- WRITER CONFIGURATION --> <output> <writerAppender active="true" class="net.sf.csv2sql.writers.JdbcExtendedBatchWriter"> <param name="batchcount" value="0"/> <param name="commitbatchcount" value="0"/> </writerAppender> <writerAppender active="false" class="net.sf.csv2sql.writers.SqlFileWriter"> <param name="filename" value="sample_loc.sql"/> </writerAppender> </output> </root> --- NEW FILE: tables.txt --- # this is list of descriptors for csv2sql utility # all descriptors have path relative to this file effect.xml addr_type.xml matrix.xml sample_loc.xml --- NEW FILE: sample_loc.csv --- ID,DELETED,CR_TS,MOD_TS,NAME,CODE,CREATOR_ID,MODIFIER_ID,COMPANY_ID "1","0","2006-10-10 15:36:36","2006-10-10 15:36:36","AFTER FILTERS","AF",NULL,NULL,NULL "2","0","2006-10-10 15:36:36","2006-10-10 15:36:36","BEFORE FILTERS","BE",NULL,NULL,NULL "3","0","2006-10-10 15:36:36","2006-10-10 15:36:36","BETWEEN FILTERS","BT",NULL,NULL,NULL "4","0","2006-10-10 15:36:36","2006-10-10 15:36:36","TREATMENT SYSTEM - EFFLUENT","EF",NULL,NULL,NULL "5","0","2006-10-10 15:36:36","2006-10-10 15:36:36","TREATMENT SYSTEM - INFLUENT","IN",NULL,NULL,NULL "6","0","2006-10-10 15:36:36","2006-10-10 15:36:36","NOT APPLICABLE","NA",NULL,NULL,NULL "7","0","2006-10-10 15:36:36","2006-10-10 15:36:36","OTHER","O",NULL,NULL,NULL "8","0","2006-10-10 15:36:36","2006-10-10 15:36:36","OUTSIDE TAP","OT",NULL,NULL,NULL "9","0","2006-10-10 15:36:36","2006-10-10 15:36:36","PRESSURE TANK","PT",NULL,NULL,NULL "10","0","2006-10-10 15:36:36","2006-10-10 15:36:36","WELLHEAD","PU",NULL,NULL,NULL "11","0","2006-10-10 15:36:36","2006-10-10 15:36:36","INSIDE TAP","T",NULL,NULL,NULL "12","0","2006-10-10 15:36:36","2006-10-10 15:36:36","UNKNOWN","U",NULL,NULL,NULL "13","0","2006-10-10 15:36:36","2006-10-10 15:36:36","NONE","NONE",NULL,NULL,NULL --- NEW FILE: addr_type.csv --- ID,DELETED,CR_TS,MOD_TS,NAME,CODE,CREATOR_ID,MODIFIER_ID,COMPANY_ID "1","0","2006-10-10 14:30:18","2006-10-10 14:30:18","Simple Address",NULL,NULL,NULL,NULL "2","0","2006-10-10 14:30:18","2006-10-10 14:30:18","Secondary address","SADR",NULL,NULL,NULL "3","0","2006-10-10 14:30:18","2006-10-10 14:30:18","Security service address","sec123123",NULL,NULL,NULL "4","0","2006-10-10 14:30:18","2006-10-10 14:30:18","Main address","MADR",NULL,NULL,NULL "10","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Billing","Billing",NULL,NULL,NULL "11","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Facility","Facility",NULL,NULL,NULL "12","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Mailing","Mailing",NULL,NULL,NULL "13","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Office","Office",NULL,NULL,NULL "14","0","2006-10-10 14:29:48","2006-10-10 14:29:48","Shipping","Shipping",NULL,NULL,NULL |
From: Vano <jj...@us...> - 2006-10-12 15:43:06
|
Update of /cvsroot/csvtosql/csvtosql/examples/test.extended.features In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27190/examples/test.extended.features Log Message: Directory /cvsroot/csvtosql/csvtosql/examples/test.extended.features added to the repository |
Update of /cvsroot/csvtosql/csvtosql/examples/test.extended.features In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27215/examples/test.extended.features Added Files: runconsole.bat build.xml mysql.jar readme.txt create_db.sql runconsole.sh Log Message: new files for test case for extended features --- 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 JdbcExtendedBatchMain 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. |
From: Vano <jj...@us...> - 2006-10-12 15:42:58
|
Update of /cvsroot/csvtosql/csvtosql/examples/test.extended.features/data In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27190/examples/test.extended.features/data Log Message: Directory /cvsroot/csvtosql/csvtosql/examples/test.extended.features/data added to the repository |
From: Vano <jj...@us...> - 2006-10-12 14:46:33
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6524/src/net/sf/csv2sql/grammars/mysql Modified Files: MysqlFieldDouble.java MysqlFieldBigint.java MysqlFieldTinyint.java MysqlFieldMediumint.java MysqlFieldChar.java MysqlFieldInt.java MysqlFieldDate.java MysqlFieldFloat.java MysqlFieldSmallint.java MysqlFieldBit.java Log Message: If csv value is equal ignore case to 'NULL' then return database null. Index: MysqlFieldSmallint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldSmallint.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldSmallint.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldSmallint.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldTinyint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldTinyint.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldTinyint.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldTinyint.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldInt.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldInt.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldInt.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldInt.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 49,52 **** --- 49,53 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} long result = Long.parseLong(strValue.trim()); Index: MysqlFieldMediumint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldMediumint.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldMediumint.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldMediumint.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} int result = Integer.parseInt(strValue.trim()); Index: MysqlFieldDate.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldDate.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldDate.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldDate.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 48,51 **** --- 48,54 ---- result = getDefaulNullValue(); } else { + String strValue = (String)value; + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} + String inputFormat = this.getFieldProperties().getProperty("inputformat"); Index: MysqlFieldBigint.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldBigint.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** MysqlFieldBigint.java 12 Mar 2005 12:34:32 -0000 1.16 --- MysqlFieldBigint.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 49,52 **** --- 49,53 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} float result = Float.parseFloat(strValue.trim()); Index: MysqlFieldBit.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldBit.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MysqlFieldBit.java 12 Mar 2005 12:34:32 -0000 1.18 --- MysqlFieldBit.java 12 Oct 2006 14:46:15 -0000 1.19 *************** *** 48,51 **** --- 48,52 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} byte result = Byte.parseByte(strValue.trim()); Index: MysqlFieldFloat.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldFloat.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** MysqlFieldFloat.java 12 Mar 2005 12:34:32 -0000 1.18 --- MysqlFieldFloat.java 12 Oct 2006 14:46:15 -0000 1.19 *************** *** 49,52 **** --- 49,53 ---- //get value String strValue = ((String)value).replaceAll(",", "."); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} long result = Long.parseLong(strValue.trim()); Index: MysqlFieldChar.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldChar.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** MysqlFieldChar.java 11 Oct 2006 14:21:44 -0000 1.20 --- MysqlFieldChar.java 12 Oct 2006 14:46:15 -0000 1.21 *************** *** 47,53 **** //get value String strValue = ((String)value); ! if ("null".equalsIgnoreCase(strValue)) { ! return getDefaulNullValue(); ! } //render --- 47,51 ---- //get value String strValue = ((String)value); ! if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} //render Index: MysqlFieldDouble.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/mysql/MysqlFieldDouble.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** MysqlFieldDouble.java 12 Mar 2005 12:34:32 -0000 1.17 --- MysqlFieldDouble.java 12 Oct 2006 14:46:15 -0000 1.18 *************** *** 49,52 **** --- 49,53 ---- //get value String strValue = ((String)value).replaceAll(",", "."); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} float result = Float.parseFloat(strValue.trim()); |
From: Vano <jj...@us...> - 2006-10-12 14:46:33
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/oracle In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6524/src/net/sf/csv2sql/grammars/oracle Modified Files: OracleFieldNumber.java OracleFieldDate.java OracleFieldVarchar.java Log Message: If csv value is equal ignore case to 'NULL' then return database null. Index: OracleFieldDate.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/oracle/OracleFieldDate.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** OracleFieldDate.java 12 Mar 2005 12:34:32 -0000 1.16 --- OracleFieldDate.java 12 Oct 2006 14:46:15 -0000 1.17 *************** *** 49,52 **** --- 49,54 ---- result = getDefaulNullValue(); } else { + String strValue = (String)value; + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); Index: OracleFieldVarchar.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/oracle/OracleFieldVarchar.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** OracleFieldVarchar.java 12 Mar 2005 12:34:32 -0000 1.17 --- OracleFieldVarchar.java 12 Oct 2006 14:46:15 -0000 1.18 *************** *** 47,50 **** --- 47,51 ---- //get value String strValue = ((String)value); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} //render Index: OracleFieldNumber.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/oracle/OracleFieldNumber.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** OracleFieldNumber.java 12 Mar 2005 12:34:32 -0000 1.18 --- OracleFieldNumber.java 12 Oct 2006 14:46:15 -0000 1.19 *************** *** 46,49 **** --- 46,50 ---- //get value String strValue = ((String)value).replaceAll(",", "."); + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} float result = Float.parseFloat(strValue.trim()); |
From: Vano <jj...@us...> - 2006-10-12 14:46:31
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/standard In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6524/src/net/sf/csv2sql/grammars/standard Modified Files: StringField.java IntegerField.java FloatField.java DateField.java Log Message: If csv value is equal ignore case to 'NULL' then return database null. Index: DateField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/standard/DateField.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** DateField.java 12 Mar 2005 12:34:51 -0000 1.22 --- DateField.java 12 Oct 2006 14:46:15 -0000 1.23 *************** *** 48,51 **** --- 48,52 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); Index: IntegerField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/standard/IntegerField.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** IntegerField.java 12 Mar 2005 12:34:51 -0000 1.17 --- IntegerField.java 12 Oct 2006 14:46:15 -0000 1.18 *************** *** 43,46 **** --- 43,47 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} result = String.valueOf(new Integer(Integer.parseInt((String)value)).intValue()); } Index: StringField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/standard/StringField.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** StringField.java 12 Mar 2005 12:34:51 -0000 1.22 --- StringField.java 12 Oct 2006 14:46:15 -0000 1.23 *************** *** 46,49 **** --- 46,50 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} value = this.truncateValue(value); value = this.escapeValue(value); Index: FloatField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/standard/FloatField.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** FloatField.java 12 Mar 2005 12:34:51 -0000 1.18 --- FloatField.java 12 Oct 2006 14:46:15 -0000 1.19 *************** *** 43,46 **** --- 43,47 ---- result = getDefaulNullValue(); } else { + if ("null".equalsIgnoreCase((String)value)) {return getDefaulNullValue();} String strFloat = ((String)value).replaceAll(",", "."); result = String.valueOf(new Float(Float.parseFloat(strFloat))); |
From: Vano <jj...@us...> - 2006-10-12 14:46:30
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/db2 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6524/src/net/sf/csv2sql/grammars/db2 Modified Files: DB2FloatField.java DB2IntegerField.java DB2DateField.java DB2StringField.java Log Message: If csv value is equal ignore case to 'NULL' then return database null. Index: DB2FloatField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/db2/DB2FloatField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2FloatField.java 12 Mar 2005 12:34:31 -0000 1.2 --- DB2FloatField.java 12 Oct 2006 14:46:15 -0000 1.3 *************** *** 44,47 **** --- 44,48 ---- } else { String strFloat = ((String)value).replaceAll(",", "."); + if ("null".equalsIgnoreCase(strFloat)) {return getDefaulNullValue();} result = String.valueOf(new Float(Float.parseFloat(strFloat))); } Index: DB2IntegerField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/db2/DB2IntegerField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2IntegerField.java 12 Mar 2005 12:34:31 -0000 1.2 --- DB2IntegerField.java 12 Oct 2006 14:46:15 -0000 1.3 *************** *** 43,46 **** --- 43,48 ---- result = getDefaulNullValue(); } else { + String strValue = (String)value; + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} result = String.valueOf(new Integer(Integer.parseInt((String)value)).intValue()); } Index: DB2StringField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/db2/DB2StringField.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DB2StringField.java 12 Mar 2005 12:34:31 -0000 1.3 --- DB2StringField.java 12 Oct 2006 14:46:15 -0000 1.4 *************** *** 46,49 **** --- 46,51 ---- result = getDefaulNullValue(); } else { + String strValue = (String)value; + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} value = this.truncateValue(value); value = this.escapeValue(value); Index: DB2DateField.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/grammars/db2/DB2DateField.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** DB2DateField.java 12 Mar 2005 12:34:31 -0000 1.2 --- DB2DateField.java 12 Oct 2006 14:46:15 -0000 1.3 *************** *** 48,51 **** --- 48,53 ---- result = getDefaulNullValue(); } else { + String strValue = (String)value; + if ("null".equalsIgnoreCase(strValue)) {return getDefaulNullValue();} String inputFormat = this.getFieldProperties().getProperty("inputformat"); |
From: consonni d. <dav...@us...> - 2006-10-12 12:39:22
|
Update of /cvsroot/csvtosql/csvtosql/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24799/lib Modified Files: AbsoluteLayout.jar commons-cli-1.0.jar jaxp.jar liquidlnf.jar Log Message: no message Index: commons-cli-1.0.jar =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/lib/commons-cli-1.0.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsFc7TJW and /tmp/cvsfSFkW6 differ Index: jaxp.jar =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/lib/jaxp.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsEtE1d0 and /tmp/cvsVxqasa differ Index: liquidlnf.jar =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/lib/liquidlnf.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvsRtTwXY and /tmp/cvszDTNg9 differ Index: AbsoluteLayout.jar =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/lib/AbsoluteLayout.jar,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 Binary files /tmp/cvs2i4xF4 and /tmp/cvseOhh1e differ |
From: consonni d. <dav...@us...> - 2006-10-12 12:39:08
|
Update of /cvsroot/csvtosql/csvtosql/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv24618/lib Modified Files: javadbf-0.4.0.jar jxl.jar metouia.jar Log Message: no message |
From: consonni d. <dav...@us...> - 2006-10-12 12:32:51
|
Update of /cvsroot/csvtosql/csvtosql_jdk50/bin In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22261/bin Modified Files: csvtosql.jar Log Message: no message Index: csvtosql.jar =================================================================== RCS file: /cvsroot/csvtosql/csvtosql_jdk50/bin/csvtosql.jar,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs4cmKI0 and /tmp/cvsK5ec8J differ |
From: Vano <jj...@us...> - 2006-10-12 10:43:49
|
Update of /cvsroot/csvtosql/csvtosql In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14724 Modified Files: build.xml Log Message: lib.src property added and then used when compiling the source. (in javac task) Index: build.xml =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build.xml 9 Mar 2005 10:23:22 -0000 1.9 --- build.xml 12 Oct 2006 10:43:45 -0000 1.10 *************** *** 26,29 **** --- 26,30 ---- <target depends="welcome" name="init"> <property location="src" name="src.dir"/> + <property location="lib" name="lib.dir"/> <property location="classes" name="classes.dir"/> <property location="." name="src.dir"/> *************** *** 39,43 **** <classpath> <pathelement path="${classpath}"/> ! <fileset dir="lib"> <include name="**/*.jar"/> </fileset> --- 40,44 ---- <classpath> <pathelement path="${classpath}"/> ! <fileset dir="${lib.dir}"> <include name="**/*.jar"/> </fileset> |
From: Vano <jj...@us...> - 2006-10-12 10:42:36
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/frontends/console In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv14362/src/net/sf/csv2sql/frontends/console Added Files: ExtendedConsoleMain.java Log Message: New frontend for importing data from the list of files with opening only one connection to the database. --- NEW FILE: ExtendedConsoleMain.java --- /* Copyright (C) 2006 Ivan Ryndin <jj...@us...> LGPL terms */ package net.sf.csv2sql.frontends.console; import java.io.File; import java.io.FileReader; import java.io.BufferedReader; import java.util.List; import java.util.Iterator; import java.util.ArrayList; import java.util.HashMap; import java.sql.Connection; import net.sf.csv2sql.configuration.XmlConfigurator; import net.sf.csv2sql.writers.AbstractWriter; import net.sf.csv2sql.utils.DBUtils; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.Options; import org.apache.commons.cli.PosixParser; /** * csv2sql extended console frontends * It is used when need to export data from several files into single database. It is not * good to open and close connection every time when processing new file. So, this frontend * opens the one connection to database and pass it as a parameter to each writer, so that this * single connection is used by all the files processors. * <p>Parameters necessary for opening of the * connection are passed as system properties to this frontend. These params are: * <ul> * <li> db.url - URL of the database * <li> db.user - User name of the database * <li> db.password - Password * <li> db.driver.class- Class of the database driver. For example, "com.mysql.jdbc.Driver". * </ul> * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> */ public class ExtendedConsoleMain { private static ExtendedConsoleMain self = new ExtendedConsoleMain(); /** * singleton pattern * return THE istance of main * @return istance of ExtendedConsoleMain */ public static ExtendedConsoleMain getInstance() { return self; } /** * Prints usage information to Console. */ private static String usage() { return " Usage: csv2sql -d filename [-b]\n\n"+ " --descriptor [-d] file containing conversion descriptor\n"+ " --help [-h] display this help\n"; } /** * Prints version information to Console. */ private static String version() { return "csv2sql, Copyright (C) 2004 Davide Consonni <dco...@en...>\n"+ "Convert a csv file in sql file\n\n"; } /** * business logic * @param descriptor point to conversion descriptor file * @param connection Connection to database used by the writers * @throws Exception if any error occured */ public void run(File descriptor, Connection connection) throws Exception { //read configuration XmlConfigurator config = new XmlConfigurator(); config.load(descriptor); if (config.CURRENT_DESCRIPTOR_VERSION != config.getDescriptorVersion()) { throw new Exception("version mismatch"); } //generate statements config.getRender().render(); //output statements Iterator it = config.getWriters().iterator(); HashMap params = new HashMap(); params.put("connection",connection); while (it.hasNext()) { AbstractWriter writer = (AbstractWriter)it.next(); writer.setWriterParameters(params); writer.write(); } } /** * program entry point * @param args argument list */ public static void main(String args []) { try { CommandLineParser parser = new PosixParser(); Options options = new Options(); options.addOption( "d", "descriptor", true, "descriptor file"); options.addOption( "h", "help", false, "display help" ); CommandLine line = parser.parse( options, args ); //no arguments ? no party. if (args.length <= 0) { System.out.println(version()); System.out.println(usage()); System.exit(1); } //display version if( line.hasOption( "h" ) ) { System.out.println(version()); System.out.println(usage()); System.exit(0); } ArrayList files = new ArrayList(); String pathPart = ""; //read filename, open file and store filenames of descriptors if( line.hasOption( "d" ) ) { try { String fileName = line.getOptionValue("d"); pathPart = fileName.substring(0,fileName.lastIndexOf(File.separator))+File.separator; BufferedReader in = new BufferedReader(new FileReader(fileName)); String s; while((s = in.readLine())!= null) { s = s.trim(); // # - this signals the beginning of the comment in the input file if (s.length()==0 || s.startsWith("#")) continue; files.add(s); } in.close(); } catch (Exception e) { e.printStackTrace(); System.exit(1); } } else { System.out.println(version()); System.out.println(usage()); System.out.println("ERROR: option --descriptor is mandatory.\n"); System.exit(1); } // connect to database Connection connection = null; try { // start benchmark long start = System.currentTimeMillis(); String dbUrl = System.getProperty("db.url"); String dbUser = System.getProperty("db.user"); String dbPassword = System.getProperty("db.password"); String dbDriverClass = System.getProperty("db.driver.class"); connection = DBUtils.openConnection(dbDriverClass,dbUrl,dbUser,dbPassword); for (int i=0; i<files.size(); i++) { String fileName = pathPart + (String)files.get(i); System.out.println("Processing file: " + fileName); File descriptor = new File(fileName); ExtendedConsoleMain.getInstance().run(descriptor,connection); } System.out.println("\nCsv converted in: "+String.valueOf(System.currentTimeMillis()-start)+" ms"); } finally { DBUtils.closeConnection(connection); } } catch( Exception e ) { e.printStackTrace(); } } } |
From: Vano <jj...@us...> - 2006-10-12 10:41:38
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/writers/exceptions In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13626/src/net/sf/csv2sql/writers/exceptions Modified Files: WriterException.java Log Message: New constructor added. Index: WriterException.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/writers/exceptions/WriterException.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** WriterException.java 11 Nov 2004 09:15:15 -0000 1.5 --- WriterException.java 12 Oct 2006 10:41:10 -0000 1.6 *************** *** 32,36 **** public WriterException(Throwable cause) { super(cause); ! } } --- 32,40 ---- public WriterException(Throwable cause) { super(cause); ! } ! ! public WriterException(String message) { ! super(message); ! } } |
From: Vano <jj...@us...> - 2006-10-12 10:40:45
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/writers In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13604/src/net/sf/csv2sql/writers Added Files: JdbcExtendedBatchWriter.java Log Message: New writer for batch sql statements executing from several files. Uses given connection to database. --- NEW FILE: JdbcExtendedBatchWriter.java --- /* Copyright (C) 2006 Ivan Ryndin <jj...@us...> LGPL terms. */ package net.sf.csv2sql.writers; import java.io.File; import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.HashMap; import net.sf.csv2sql.storage.exceptions.StorageException; import net.sf.csv2sql.utils.DBUtils; import net.sf.csv2sql.writers.exceptions.InvalidParameterValueException; import net.sf.csv2sql.writers.exceptions.WriterException; /** * Load generated statements in a jdbc resource with batch method. * Use given connection. After having commit done doesn't close * connection. This is convinient when importing data from several files * one after another into the same database. Doesn't waste time for open and close * connection after each file data processed. * @see * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> * @version $Revision: 1.1 $, $Date: 2006/10/11 * @since 3.0 */ public class JdbcExtendedBatchWriter extends AbstractWriter { int batchCount; int commitBatchCount; private void init() throws InvalidParameterValueException { batchCount = Integer.parseInt(getWriterProperties().getProperty("batchcount", "10")); //optional commitBatchCount = Integer.parseInt(getWriterProperties().getProperty("commitbatchcount", "0")); } /** * @see AbstractWriter#write */ public void write() throws WriterException{ //get configuration options init(); String currentSQL = null; int sqlIndex = 0; try { HashMap params = getWriterParameters(); if (params == null) throw new WriterException("Cannot get writer parameters! Returned HashMap is null"); Connection connection = (Connection)params.get("connection"); if (connection==null) throw new WriterException("Cannot get not-null connection! Set please connection to database in writer parameters"); Statement stmt = connection.createStatement(); try { //start transaction if (commitBatchCount != 1) { connection.setAutoCommit(false); } int batchSize = 0; int commitIdx = 0; for (int i=0; i<getStorage().size(); i++) { String sql = getStorage().get(i); stmt.addBatch(sql); sqlIndex++; currentSQL = sql; if (++batchSize == batchCount) { batchSize = 0; stmt.executeBatch(); if (commitBatchCount > 1 && commitBatchCount == ++commitIdx) { connection.commit(); commitIdx = 0; } stmt.clearBatch(); } } // take care of the remaining records. stmt.executeBatch(); stmt.clearBatch(); //stop transaction if (commitBatchCount != 1) { connection.commit(); } } finally { stmt.close(); } } catch (StorageException e) { throw new WriterException("cannot read data from temporary storage", e); } catch (SQLException e) { throw new WriterException("cannot write statement to database: " + sqlIndex + "\n" + e.getMessage() + "\n" + currentSQL, e); } } protected HashMap requiredParameterList() { HashMap hm = new HashMap(); hm.put("commitbatchcount","commitbatchcount."); return hm; } protected HashMap optionalParameterList() { HashMap hm = new HashMap(); hm.put("batchcount","batchcount."); return hm; } } |
From: Vano <jj...@us...> - 2006-10-12 10:40:03
|
Update of /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/writers In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv13211/src/net/sf/csv2sql/writers Modified Files: AbstractWriter.java Log Message: Methods for getting and setting writer parameters added. Parameters are packed into HashMap. Index: AbstractWriter.java =================================================================== RCS file: /cvsroot/csvtosql/csvtosql/src/net/sf/csv2sql/writers/AbstractWriter.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** AbstractWriter.java 5 Nov 2004 16:28:47 -0000 1.20 --- AbstractWriter.java 12 Oct 2006 10:39:49 -0000 1.21 *************** *** 47,50 **** --- 47,55 ---- private Properties properties; private Storage storage; + /** + * Writer parameters. + * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> + */ + private HashMap parameters = null; /** *************** *** 106,110 **** protected abstract HashMap requiredParameterList(); ! protected abstract HashMap optionalParameterList(); } --- 111,133 ---- protected abstract HashMap requiredParameterList(); ! protected abstract HashMap optionalParameterList(); + /** + * This is used for setting of any required Parameters for writer + * @param parameters java.util.HashMap containing writer parameters. Keys are parameter + * identifiers, and appropriate values are parameters itself. + * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> + */ + public void setWriterParameters(HashMap parameters) { + this.parameters = parameters; + } + + /** + * This is used for getting of any required Parameters for writer + * @return Parameters of the writer. Can be null. + * @author <a href="mailto:jj...@us...">Ivan Ryndin</a> + */ + public HashMap getWriterParameters() { + return parameters; + } } |