Extract Data from DBF Files

One Star

Extract Data from DBF Files

Most of the data wherin i will use talend are foxpro database. How do i connect to this system using talend.
Tags (1)
Employee

Re: Extract Data from DBF Files

Jean-François Mony from Camptocamp has just sent us a tFileInputXbase component written for his own need. We should soon provide a way for users/contributors to share components. For now, you can download it and follow our wiki instructions to deploy a new user-defined component. TOS 2.0.0 or later required.
One Star

Re: Extract Data from DBF Files

Hi!
I'm also integrested in the DBF component. However there seem to be an permission problem for this file on the talendforge server: I get error "You don't have permission to access /downloads/tFileInputXbase.zip on this server.".
Regards,
Christian
Employee

Re: Extract Data from DBF Files

I have just changed permission on that file on our server. You can download it now.
Sorry for the inconvenience.
Best Regards,
Michaël
One Star

Re: Extract Data from DBF Files

Thanks alot!
/ Christian
One Star

Re: Extract Data from DBF Files

Hi:
I need your help about this topic. I have a visual Foxpro database, but I don't know how to connect it with Talend. I have already downloaded the tFileInputXbase component. Would you mind explaining me the steps, please? I will thank a lot,
regards
Fahed
One Star

Re: Extract Data from DBF Files

Hi everybody,
I've just installed and integrate in a project this Xbase Component
but when i try to run my project i have the following error:
starting job TestJob at 11:12 26/04/2007.
Can't locate Xbase.pm in @INC (@INC contains: C:/Program Files/TOS-2.0.0/workspace/.Perl C:\Program Files\TOS-2.0.0\lib\perl C:/Program Files/TOS-2.0.0/perl/lib C:/Program Files/TOS-2.0.0/perl/site/lib .) at C:\Program Files\TOS-2.0.0\workspace\.Perl\PROJECT.job_TestJob.pl line 1240.
BEGIN failed--compilation aborted at C:\Program Files\TOS-2.0.0\workspace\.Perl\PROJECT.job_TestJob.pl line 1240.
Job TestJob ended at 11:12 26/04/2007.
if anybody have an idea ....

Thx by advance
Employee

Re: Extract Data from DBF Files

debecdel, in your PPM manager, install DBD::Xbase Perl module
One Star

Re: Extract Data from DBF Files

Hi all,
i'm using the tFileInputXbase component but i always obtain this error when i execute the job:
Starting job ImportAnagraficaCV at 14:34 28/01/2008.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
start_column_tFileInputXbase_1 cannot be resolved
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.tFileInputXbase_1Process(ImportAnagraficaCV.java:321)
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.runJob(ImportAnagraficaCV.java:658)
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.main(ImportAnagraficaCV.java:594)
Job ImportAnagraficaCV ended at 14:34 28/01/2008.
Can you help me ?
Many thanks,
Alessandro
Community Manager

Re: Extract Data from DBF Files

Hi all,
i'm using the tFileInputXbase component but i always obtain this error when i execute the job:
Starting job ImportAnagraficaCV at 14:34 28/01/2008.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
start_column_tFileInputXbase_1 cannot be resolved
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.tFileInputXbase_1Process(ImportAnagraficaCV.java:321)
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.runJob(ImportAnagraficaCV.java:658)
at migrazione_azcv.importanagraficacv.ImportAnagraficaCV.main(ImportAnagraficaCV.java:594)
Job ImportAnagraficaCV ended at 14:34 28/01/2008.
Can you help me ?
Many thanks,
Alessandro

Hi
Please go to the code tab and show the error code. It is better to show more information of your job, so we can give you precise response.
Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: Extract Data from DBF Files

Hi,
please find below the error message and the generated java source.
Starting job ImportDataCV at 13:51 04/02/2008.
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
start_column_tFileInputXbase_1 cannot be resolved
at migrazione_dati.importdatacv.ImportDataCV.tFileInputXbase_1Process(ImportDataCV.java:337)
at migrazione_dati.importdatacv.ImportDataCV.runJob(ImportDataCV.java:790)
at migrazione_dati.importdatacv.ImportDataCV.main(ImportDataCV.java:726)
Job ImportDataCV ended at 13:51 04/02/2008.
Many thanks,
Alessandro
// ============================================================================
//
// Copyright (c) 2005-2007, Talend Inc.
//
// This source code has been automatically generated by Talend Open Studio
// / JobDesigner (CodeGenerator version 2.2.3.r7292).
// You can find more information about Talend products at www.talend.com.
// You may distribute this code under the terms of the GNU LGPL license
// (http://www.gnu.org/licenses/lgpl.html).
//
// ============================================================================
package migrazione_dati.importdatacv;
import routines.DataOperation;
import routines.Mathematical;
import routines.Numeric;
import routines.Relational;
import routines.StringHandling;
import routines.TalendDate;
import routines.TalendString;
import routines.system.*;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
* Job: ImportDataCV Purpose: <br>
* Description: <br>
*
* @author alessandro.benedetti@pfizer.com
* @version 0.1
* @status
*/
public class ImportDataCV {
// create and load default properties
private static java.util.Properties defaultProps = new java.util.Properties();
// create application properties with default
private static java.util.Properties context = new java.util.Properties();
private static final String jobName = "ImportDataCV";
private static final String projectName = "MIGRAZIONE_DATI";
public static Integer errorCode = null;
private static String currentComponent = "";
private static final java.util.Map<String, Long> start_Hash = new java.util.HashMap<String, Long>();
private static final java.util.Map<String, Long> end_Hash = new java.util.HashMap<String, Long>();
private static final java.util.Map<String, Boolean> ok_Hash = new java.util.HashMap<String, Boolean>();
private static final java.util.Map<String, Object> globalMap = new java.util.HashMap<String, Object>();
private class TalendException extends Exception {
private Exception e = null;
private ImportDataCV c = null;
private TalendException(ImportDataCV c, Exception e) {
this.e = e;
this.c = c;
}
@Override
public void printStackTrace() {
if (!(e instanceof TalendException || e instanceof TDieException)) {
System.err
.println("Exception in component " + currentComponent);
}
if (!(e instanceof TDieException)) {
e.printStackTrace();
}
if (!(e instanceof TalendException)) {
try {
for (java.lang.reflect.Method m : this.getClass()
.getEnclosingClass().getMethods()) {
if (m.getName().compareTo(currentComponent + "_error") == 0) {
m.invoke(c, (Object[]) null);
break;
}
}
} catch (java.lang.SecurityException e) {
this.e.printStackTrace();
} catch (java.lang.IllegalArgumentException e) {
this.e.printStackTrace();
} catch (java.lang.IllegalAccessException e) {
this.e.printStackTrace();
} catch (java.lang.reflect.InvocationTargetException e) {
this.e.printStackTrace();
}
}
}
}
public void tFileInputXbase_1_error() throws TalendException {
end_Hash.put("tFileInputXbase_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tMap_1_error() throws TalendException {
end_Hash.put("tMap_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tMysqlOutput_1_error() throws TalendException {
end_Hash.put("tMysqlOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
public void tMysqlConnection_1_error() throws TalendException {
end_Hash.put("tMysqlConnection_1", java.util.Calendar.getInstance()
.getTimeInMillis());
}
private class caricaStruct {
private char CODICE;
private char CLIENTE;
private char MOVIMENTO;
private Double DARE;
private Double AVERE;
private Double VERSATO;
private java.util.Date DATA;
private char N_FAT;
private char TIPO;
private char SIT;
}
private class row1Struct {
private Character CODICE;
private Character CLIENTE;
private Character MOVIMENTO;
private Double DARE;
private Double AVERE;
private Double VERSATO;
private java.util.Date DATA;
private Character N_FAT;
private Character TIPO;
private Character SIT;
}
public void tFileInputXbase_1Process() throws TalendException {
try {
row1Struct row1 = new row1Struct();
caricaStruct carica = new caricaStruct();
/**
* start
*/
ok_Hash.put("tMysqlOutput_1", false);
start_Hash.put("tMysqlOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tMysqlOutput_1";
int nb_line_tMysqlOutput_1 = 0;
int nb_line_update_tMysqlOutput_1 = 0;
int nb_line_inserted_tMysqlOutput_1 = 0;
int nb_line_deleted_tMysqlOutput_1 = 0;
int deletedCount_tMysqlOutput_1 = 0;
int updatedCount_tMysqlOutput_1 = 0;
int insertedCount_tMysqlOutput_1 = 0;
boolean whetherReject_tMysqlOutput_1 = false;
java.util.Calendar calendar_tMysqlOutput_1 = java.util.Calendar
.getInstance();
calendar_tMysqlOutput_1.set(1, 0, 1, 0, 0, 0);
long year1_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime()
.getTime();
calendar_tMysqlOutput_1.set(10000, 0, 1, 0, 0, 0);
long year10000_tMysqlOutput_1 = calendar_tMysqlOutput_1.getTime()
.getTime();
long date_tMysqlOutput_1;
java.sql.Connection conn_tMysqlOutput_1 = null;
conn_tMysqlOutput_1 = (java.sql.Connection) globalMap
.get("conn_tMysqlConnection_1");
java.sql.Statement stmtClearCount_tMysqlOutput_1 = conn_tMysqlOutput_1
.createStatement();
java.sql.ResultSet rsClearCount_tMysqlOutput_1 = stmtClearCount_tMysqlOutput_1
.executeQuery("select count(1) from `" + "gaz_fatbol1"
+ "`");
java.sql.Statement stmtClear_tMysqlOutput_1 = conn_tMysqlOutput_1
.createStatement();
stmtClear_tMysqlOutput_1.executeUpdate("truncate table `"
+ "gaz_fatbol1" + "`");
while (rsClearCount_tMysqlOutput_1.next()) {
deletedCount_tMysqlOutput_1 += rsClearCount_tMysqlOutput_1
.getInt(1);
}
java.sql.PreparedStatement pstmt_tMysqlOutput_1 = null;
pstmt_tMysqlOutput_1 = conn_tMysqlOutput_1
.prepareStatement("INSERT INTO `"
+ "gaz_fatbol1"
+ "` (`CODICE`,`CLIENTE`,`MOVIMENTO`,`DARE`,`AVERE`,`VERSATO`,`DATA`,`N_FAT`,`TIPO`,`SIT`) VALUES (?,?,?,?,?,?,?,?,?,?)");
/**
* stop
*/
/**
* start
*/
ok_Hash.put("tMap_1", false);
start_Hash.put("tMap_1", java.util.Calendar.getInstance()
.getTimeInMillis());
currentComponent = "tMap_1";
// ###############################
// # Lookup's keys initialization
// ###############################
// ###############################
// # Vars initialization
class Var__tMap_1__Struct {
}
Var__tMap_1__Struct Var__tMap_1 = new Var__tMap_1__Struct();
// ###############################
// ###############################
// # Outputs initialization
caricaStruct carica_tmp = new caricaStruct();
// ###############################
/**
* stop
*/
/**
* start
*/
ok_Hash.put("tFileInputXbase_1", false);
start_Hash.put("tFileInputXbase_1", java.util.Calendar
.getInstance().getTimeInMillis());
currentComponent = "tFileInputXbase_1";
final com.linuxense.javadbf.DBFReader dbfReadertFileInputXbase_1 = new com.linuxense.javadbf.DBFReader(
new java.io.FileInputStream("W:/Dati_Cantina/SALDOCL.DBF"));
int nb_line_tFileInputXbase_1 = 0;
int begin_line_tFileInputXbase_1 = 0;
int end_line_tFileInputXbase_1 = dbfReadertFileInputXbase_1
.getRecordCount() - 0;
int limit_tFileInputXbase_1 = -1;
Object[] rowObjects_tFileInputXbase_1 = null;
if (begin_line_tFileInputXbase_1 > 0) {
for (int i_tFileInputXbase_1 = 0; i_tFileInputXbase_1 < begin_line_tFileInputXbase_1; i_tFileInputXbase_1++) {
rowObjects_tFileInputXbase_1 = dbfReadertFileInputXbase_1
.nextRecord();
}
}
for (int i_tFileInputXbase_1 = begin_line_tFileInputXbase_1; i_tFileInputXbase_1 < end_line_tFileInputXbase_1; i_tFileInputXbase_1++) {
if (limit_tFileInputXbase_1 != -1
&& nb_line_tFileInputXbase_1 >= limit_tFileInputXbase_1) {
break;
}
rowObjects_tFileInputXbase_1 = dbfReadertFileInputXbase_1
.nextRecord();
String[] temp_row_tFileInputXbase_1 = new String;
for (int i = 0; i < 10; i++) {
temp_row_tFileInputXbase_1 = rowObjects_tFileInputXbase_1
.toString();
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.CODICE = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.CODICE = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.CLIENTE = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.CLIENTE = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.MOVIMENTO = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.MOVIMENTO = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.DARE = ParserUtils
.parseTo_Double(temp_row_tFileInputXbase_1);
} else {
row1.DARE = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.AVERE = ParserUtils
.parseTo_Double(temp_row_tFileInputXbase_1);
} else {
row1.AVERE = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.VERSATO = ParserUtils
.parseTo_Double(temp_row_tFileInputXbase_1);
} else {
row1.VERSATO = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
try {
row1.DATA = ParserUtils.parseTo_Date(
temp_row_tFileInputXbase_1, null);
} catch (Exception e) {
throw new Exception(
"The cell format is not Date in row "
+ (nb_line_tFileInputXbase_1 + 1)
+ " column "
+ (6 + start_column_tFileInputXbase_1 + 1));
}
} else {
row1.DATA = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.N_FAT = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.N_FAT = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.TIPO = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.TIPO = null;
}
if (temp_row_tFileInputXbase_1.length() > 0) {
row1.SIT = ParserUtils
.parseTo_Character(temp_row_tFileInputXbase_1);
} else {
row1.SIT = null;
}
/**
* stop
*/
/**
* start
*/
currentComponent = "tFileInputXbase_1";
/**
* stop
*/
/**
* start
*/
currentComponent = "tMap_1";
boolean rejectedInnerJoin_tMap_1 = false;
// ###############################
// # Input tables (lookups)
// ###############################
{ // start of Var scope
// ###############################
// # Vars tables
Var__tMap_1__Struct Var = Var__tMap_1;
// ###############################
// ###############################
// # Output tables
carica = null;
// # Output table : 'carica'
carica_tmp.CODICE = row1.CODICE;
carica_tmp.CLIENTE = row1.CLIENTE;
carica_tmp.MOVIMENTO = row1.MOVIMENTO;
carica_tmp.DARE = row1.DARE;
carica_tmp.AVERE = row1.AVERE;
carica_tmp.VERSATO = row1.VERSATO;
carica_tmp.DATA = row1.DATA;
carica_tmp.N_FAT = row1.N_FAT;
carica_tmp.TIPO = row1.TIPO;
carica_tmp.SIT = row1.SIT;
carica = carica_tmp;
// ###############################
} // end of Var scope
rejectedInnerJoin_tMap_1 = false;
/**
* stop
*/
// Start of branch "carica"
if (carica != null) {
/**
* start
*/
currentComponent = "tMysqlOutput_1";
whetherReject_tMysqlOutput_1 = false;
if (String.valueOf(carica.CODICE).toLowerCase().equals(
"null")) {
pstmt_tMysqlOutput_1.setNull(1, java.sql.Types.CHAR);
} else if (carica.CODICE == '\0') {
pstmt_tMysqlOutput_1.setString(1, "");
} else {
pstmt_tMysqlOutput_1.setString(1, String
.valueOf(carica.CODICE));
}
if (String.valueOf(carica.CLIENTE).toLowerCase().equals(
"null")) {
pstmt_tMysqlOutput_1.setNull(2, java.sql.Types.CHAR);
} else if (carica.CLIENTE == '\0') {
pstmt_tMysqlOutput_1.setString(2, "");
} else {
pstmt_tMysqlOutput_1.setString(2, String
.valueOf(carica.CLIENTE));
}
if (String.valueOf(carica.MOVIMENTO).toLowerCase().equals(
"null")) {
pstmt_tMysqlOutput_1.setNull(3, java.sql.Types.CHAR);
} else if (carica.MOVIMENTO == '\0') {
pstmt_tMysqlOutput_1.setString(3, "");
} else {
pstmt_tMysqlOutput_1.setString(3, String
.valueOf(carica.MOVIMENTO));
}
if (carica.DARE == null) {
pstmt_tMysqlOutput_1.setNull(4, java.sql.Types.DOUBLE);
} else {
pstmt_tMysqlOutput_1.setDouble(4, carica.DARE);
}
if (carica.AVERE == null) {
pstmt_tMysqlOutput_1.setNull(5, java.sql.Types.DOUBLE);
} else {
pstmt_tMysqlOutput_1.setDouble(5, carica.AVERE);
}
if (carica.VERSATO == null) {
pstmt_tMysqlOutput_1.setNull(6, java.sql.Types.DOUBLE);
} else {
pstmt_tMysqlOutput_1.setDouble(6, carica.VERSATO);
}
if (carica.DATA != null) {
// timestamp < min java date value (year 1) || timestamp
// > max mysql value (year 10000) => set 0000-00-00 as
// date in MySQL
date_tMysqlOutput_1 = carica.DATA.getTime();
if (date_tMysqlOutput_1 < year1_tMysqlOutput_1
|| date_tMysqlOutput_1 >= year10000_tMysqlOutput_1) {
pstmt_tMysqlOutput_1.setString(7,
"0000-00-00 00:00:00");
} else {
pstmt_tMysqlOutput_1
.setTimestamp(7, new java.sql.Timestamp(
date_tMysqlOutput_1));
}
} else {
pstmt_tMysqlOutput_1.setNull(7, java.sql.Types.DATE);
}
if (String.valueOf(carica.N_FAT).toLowerCase().equals(
"null")) {
pstmt_tMysqlOutput_1.setNull(8, java.sql.Types.CHAR);
} else if (carica.N_FAT == '\0') {
pstmt_tMysqlOutput_1.setString(8, "");
} else {
pstmt_tMysqlOutput_1.setString(8, String
.valueOf(carica.N_FAT));
}
if (String.valueOf(carica.TIPO).toLowerCase()
.equals("null")) {
pstmt_tMysqlOutput_1.setNull(9, java.sql.Types.CHAR);
} else if (carica.TIPO == '\0') {
pstmt_tMysqlOutput_1.setString(9, "");
} else {
pstmt_tMysqlOutput_1.setString(9, String
.valueOf(carica.TIPO));
}
if (String.valueOf(carica.SIT).toLowerCase().equals("null")) {
pstmt_tMysqlOutput_1.setNull(10, java.sql.Types.CHAR);
} else if (carica.SIT == '\0') {
pstmt_tMysqlOutput_1.setString(10, "");
} else {
pstmt_tMysqlOutput_1.setString(10, String
.valueOf(carica.SIT));
}
try {
insertedCount_tMysqlOutput_1 = insertedCount_tMysqlOutput_1
+ pstmt_tMysqlOutput_1.executeUpdate();
nb_line_tMysqlOutput_1++;
} catch (Exception e) {
whetherReject_tMysqlOutput_1 = true;
throw (e);
}
/**
* stop
*/
} // End of branch "carica"
/**
* start
*/
currentComponent = "tFileInputXbase_1";
nb_line_tFileInputXbase_1++;
}
globalMap.put("tFileInputXbase_1_NB_LINE",
nb_line_tFileInputXbase_1);
ok_Hash.put("tFileInputXbase_1", true);
end_Hash.put("tFileInputXbase_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
/**
* start
*/
currentComponent = "tMap_1";
// ###############################
// # Lookup hashes releasing
ok_Hash.put("tMap_1", true);
end_Hash.put("tMap_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
/**
* start
*/
currentComponent = "tMysqlOutput_1";
pstmt_tMysqlOutput_1.close();
nb_line_deleted_tMysqlOutput_1 = nb_line_deleted_tMysqlOutput_1
+ deletedCount_tMysqlOutput_1;
nb_line_update_tMysqlOutput_1 = nb_line_update_tMysqlOutput_1
+ updatedCount_tMysqlOutput_1;
nb_line_inserted_tMysqlOutput_1 = nb_line_inserted_tMysqlOutput_1
+ insertedCount_tMysqlOutput_1;
globalMap.put("tMysqlOutput_1_NB_LINE", nb_line_tMysqlOutput_1);
globalMap.put("tMysqlOutput_1_NB_LINE_UPDATED",
nb_line_update_tMysqlOutput_1);
globalMap.put("tMysqlOutput_1_NB_LINE_INSERTED",
nb_line_inserted_tMysqlOutput_1);
globalMap.put("tMysqlOutput_1_NB_LINE_DELETED",
nb_line_deleted_tMysqlOutput_1);
ok_Hash.put("tMysqlOutput_1", true);
end_Hash.put("tMysqlOutput_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
} catch (Exception e) {
throw new TalendException(this, e);
}
}
public void tMysqlConnection_1Process() throws TalendException {
try {
/**
* start
*/
ok_Hash.put("tMysqlConnection_1", false);
start_Hash.put("tMysqlConnection_1", java.util.Calendar
.getInstance().getTimeInMillis());
currentComponent = "tMysqlConnection_1";
java.lang.Class.forName("org.gjt.mm.mysql.Driver");
String url_tMysqlConnection_1 = "jdbc:mysql://" + "localhost" + ":"
+ "3306" + "/" + "gazie" + "?noDatetimeStringSync=true";
String userName_tMysqlConnection_1 = "root";
String password_tMysqlConnection_1 = "alexander";
java.sql.Connection conn_tMysqlConnection_1 = java.sql.DriverManager
.getConnection(url_tMysqlConnection_1,
userName_tMysqlConnection_1,
password_tMysqlConnection_1);
conn_tMysqlConnection_1.setAutoCommit(false);
globalMap.put("conn_" + "tMysqlConnection_1",
conn_tMysqlConnection_1);
/**
* stop
*/
/**
* start
*/
currentComponent = "tMysqlConnection_1";
/**
* stop
*/
/**
* start
*/
currentComponent = "tMysqlConnection_1";
ok_Hash.put("tMysqlConnection_1", true);
end_Hash.put("tMysqlConnection_1", java.util.Calendar.getInstance()
.getTimeInMillis());
/**
* stop
*/
} catch (Exception e) {
throw new TalendException(this, e);
}
}
public static boolean watch = false;
public static int portStats = 3334;
public static int portTraces = 4334;
public static String clientHost;
public static String defaultClientHost = "localhost";
public static String contextStr = "Default";
public static String pid = "0";
public static String rootPid = null;
public static String fatherPid = null;
private static java.util.Properties context_param = new java.util.Properties();
public static String status = "";
public static void main(String[] args) {
int exitCode = runJob(args);
System.exit(exitCode);
}
public static int runJob(String[] args) {
String lastStr = "";
for (String arg : args) {
if (arg.equalsIgnoreCase("--context_param")) {
lastStr = arg;
} else if (lastStr.equals("")) {
evalParam(arg);
} else {
evalParam(lastStr + " " + arg);
lastStr = "";
}
}
if (clientHost == null) {
clientHost = defaultClientHost;
}
pid = TalendString.getAsciiRandomString(6);
if (rootPid == null) {
rootPid = pid;
}
if (fatherPid == null) {
fatherPid = pid;
}
try {
java.io.InputStream inContext = ImportDataCV.class
.getClassLoader()
.getResourceAsStream(
"migrazione_dati/importdatacv/contexts/Default.properties");
if (inContext != null) {
defaultProps.load(inContext);
inContext.close();
context = new java.util.Properties(defaultProps);
}
if (contextStr.compareTo("Default") != 0) {
inContext = ImportDataCV.class.getClassLoader()
.getResourceAsStream(
"migrazione_dati/importdatacv/contexts/"
+ contextStr + ".properties");
if (inContext != null) {
context.load(inContext);
inContext.close();
}
}
if (!context_param.isEmpty()) {
context.putAll(context_param);
}
} catch (java.io.IOException ie) {
System.err.println("Could not load context " + contextStr);
ie.printStackTrace();
}
long end = 0;
long start = java.util.Calendar.getInstance().getTimeInMillis();
ImportDataCV ImportDataCVClass = new ImportDataCV();
try {
ImportDataCVClass.tFileInputXbase_1Process();
ImportDataCVClass.tMysqlConnection_1Process();
} catch (TalendException e) {
status = "failure";
e.printStackTrace();
} finally {
end = java.util.Calendar.getInstance().getTimeInMillis();
if (watch) {
System.out.println((end - start) + " milliseconds");
}
}
if (errorCode == null) {
return status != null && status.equals("failure") ? 1 : 0;
} else {
return errorCode.intValue();
}
}
public static void evalParam(String arg) {
if (arg.startsWith("--watch")) {
watch = true;
} else if (arg.startsWith("--stat_port=")) {
portStats = Integer.parseInt(arg.substring(12));
} else if (arg.startsWith("--trace_port=")) {
portTraces = Integer.parseInt(arg.substring(13));
} else if (arg.startsWith("--client_host=")) {
clientHost = arg.substring(14);
} else if (arg.startsWith("--context=")) {
contextStr = arg.substring(10);
} else if (arg.startsWith("--father_pid=")) {
fatherPid = arg.substring(13);
} else if (arg.startsWith("--root_pid=")) {
rootPid = arg.substring(11);
} else if (arg.startsWith("--context_param")) {
String keyValue = arg.substring(16);
int index = -1;
if (keyValue != null && (index = keyValue.indexOf('=')) > -1) {
context_param.put(keyValue.substring(0, index), keyValue
.substring(index + 1));
}
}
}
}
/*******************************************************************************
* 22839 characters generated by Talend OpenStudio on the 4 febbraio 2008
* 13.48.39 CET
******************************************************************************/
Not applicable

Re: Extract Data from DBF Files

I am in need of a solution to this problem as well. Same error message.
Five Stars

Re: Extract Data from DBF Files

I use VFP tables (.dbf/.dbc) a lot with Talend and while it isn't the best solution (and I have been lobbying Talend for improved VFP support), I've been able to use the Generic ODBC Connector coupled with the Microsoft Visual FoxPro ODBC driver.
You can download the VFP ODBC drivers at:
http://msdn.microsoft.com/en-us/vfoxpro/bb190233.aspx
If you do a search foxpro, you'll find a few of my posts, but I note a few things to watch out for in the following:
http://www.talendforge.org/forum/viewtopic.php?pid=20829#p20829

- Brian
One Star

Re: Extract Data from DBF Files

"
New member
Company: Free
Registered: 2007-04-26
Posts: 2
Website
Re: Extract Data from DBF Files
Hi everybody,
I've just installed and integrate in a project this Xbase Component
but when i try to run my project i have the following error:
starting job TestJob at 11:12 26/04/2007.
Can't locate Xbase.pm in @INC (@INC contains: C:/Program Files/TOS-2.0.0/workspace/.Perl C:\Program Files\TOS-2.0.0\lib\perl C:/Program Files/TOS-2.0.0/perl/lib C:/Program Files/TOS-2.0.0/perl/site/lib .) at C:\Program Files\TOS-2.0.0\workspace\.Perl\PROJECT.job_TestJob.pl line 1240.
BEGIN failed--compilation aborted at C:\Program Files\TOS-2.0.0\workspace\.Perl\PROJECT.job_TestJob.pl line 1240.
Job TestJob ended at 11:12 26/04/2007.
if anybody have an idea ....

Thx by advance "


"debecdel, in your PPM manager, install DBD::Xbase Perl module"

I have the same problem and tried to install the DBD::Xbase Perl Module in the command line but it show me this:
cpan> install DBD::Xbase
Fetching with LWP....
Going To Write C:\Perl\cpan\Metadata
Warning: Cannot install DBD::Xbase, don`t know what it is.
Try the command
i /DBD::Xbase/

I don´t know what to do, someone can help me?
One Star

Re: Extract Data from DBF Files

debecdel, in your PPM manager, install DBD::Xbase Perl module

i already installed the DBD::Xbase Perl module, it appears in the PPM, then i tried to run a job using the tFileInputXbase but it's still showing me the same message than debecdel.
what should be the problem?? i hope someone can help me
thanks by advance