One Star

Help to understant error tSybaseInput -> tMysqlOutput

Environnement description
TOS : 2.1.0.rc4515
OS : Windows xp
Error message

*************************************************************
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
The method setString(int, String) in the type PreparedStatement is not applicable for the arguments (int, SimpleDateFormat)
yyyy cannot be resolved
MM cannot be resolved
Syntax error, insert ")" to complete ClassInstanceCreationExpression
Syntax error, insert ")" to complete MethodInvocation
Syntax error, insert ";" to complete BlockStatements
dd cannot be resolved
ss cannot be resolved
Syntax error on token ")", delete this token
Syntax error on token ")", delete this token
The method setString(int, String) in the type PreparedStatement is not applicable for the arguments (int, SimpleDateFormat)
yyyy cannot be resolved
MM cannot be resolved
Syntax error, insert ")" to complete ClassInstanceCreationExpression
Syntax error, insert ")" to complete MethodInvocation
Syntax error, insert ";" to complete BlockStatements
dd cannot be resolved
ss cannot be resolved
Syntax error on token ")", delete this token
Syntax error on token ")", delete this token
at checkprocess.finprocess.FinProcess.tSybaseInput_1Process(FinProcess.java:499)
at checkprocess.finprocess.FinProcess.main(FinProcess.java:704)
Job FinProcess ended at 12:07 16/07/2007.

*****************************************************
Issues Description
I?m trying to import data from Sybase to Mysql
There are not transformation in the job
I?m using a tSybaseInput
It is look like I have a problem with the date format but I can not understand why
The date format is dd/mm/yyyy hh:mi:ss:mi

I try to import data whiteout date and it?s work properly
Thx
DN
8 REPLIES
Not applicable

Re: Help to understant error tSybaseInput -> tMysqlOutput

Maybe that you didn't have date pattern enclosed with quotation mark?
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

Sding
No,
Don't have a pattern declared.
DN
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

Where is your setString(int, String) method used? According to the error, you are using this method and sending it a int and a SimpleDateFormat which is not a string or a date but a object used to parse a date and give it a new format.
whereever you are using this method, you should make sure that the field or object you are sending it is a STRING.
Click on the "CODE" tab in talend and looks at the code section where the error is happening (a red sqare will be shown at the right of the code window).
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

sologlobe
Yhat exactely my problem
I'm not using routin or staff like that is all about Talend Code Generation
It's a simple job between to table
I think that my problem is about the Date format in the Sybase table (dd-mm-yyyy hh:mi:ss:ms) and the date format in the tMysqlOutput is not manage this king of data type
DN
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

Well then, maybe you just found a bug or something, try to reproduce it the simplest way possible and add it to the bug tracker.
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

Hello,
I have the same pb when I try to copy data from Oracle to Mysql with toracleInput and tmysqlOutput component.
The message error is:
"....Exception in thread "main" java.lang.Error: Unresolved compilation problems:
....The method setString(int, String) in the type PreparedStatement is not applicable for the arguments (int, SimpleDateFormat)
yyyy cannot be resolved ...."
The java code witch generate this error is:
if(row1.DATEMISEAJOURAP!=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 = row1.DATEMISEAJOURAP.getTime();
if (date_tMysqlOutput_1 < year1_tMysqlOutput_1 || date_tMysqlOutput_1 >= year10000_tMysqlOutput_1) {
pstmtUpdate_tMysqlOutput_1.setString(6, "0000-00-00 00:00:00");
} else {
pstmtUpdate_tMysqlOutput_1.setString(6, new java.text.SimpleDateFormat(yyyy-MM-dd HH:mm:ss).format(row1.DATEMISEAJOURAP));
}
}else{

pstmtUpdate_tMysqlOutput_1.setNull(6,java.sql.Types.DATE);

thks,
Best regards.
One Star

Re: Help to understant error tSybaseInput -> tMysqlOutput

Driss
I think the probleme is about the date format in mysql.
We probably should convert date in the input to yyyy-dd-mm and if it equal to 0000-00-00 change it to 9999-01-01
DN

Re: Help to understant error tSybaseInput -> tMysqlOutput

I am migrating data from one mysql db server to the other. I am sending it from tMysqlInput_1 to tMysqlInput_3. There are no other components in the job... The query is of select from source table to destination table. The respective table is not present on the destination database. So I have set action on table as create table if not exists, and action on data as insert. But error comes after running the job as
tMysqlOutput_3 cannot be resolved to a variable
the detailed error is
Error in the component's properties:batchSizeCounter_tMysqlOutput_3 cannot be resolved to a variable
batchSize_tMysqlOutput_3 cannot be resolved to a variable
batchSizeCounter_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved
batchSizeCounter_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved
batchSizeCounter_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved
batchSizeCounter_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved
pstmt_tMysqlOutput_3 cannot be resolved to a variable
pstmt_tMysqlOutput_3 cannot be resolved
pstmt_tMysqlOutput_3 cannot be resolved

Please guide me friends...
Also I am unable to run ETL of another job on linux machine through cron command.
The code in the runnable .sh file is -
cd `dirname $0`
ROOT_PATH=`/root/t_followup_0.1.zip_FILES`
java -Xms256M -Xmx1024M -cp $ROOT_PATH/../lib/mysql-connector-java-5.1.22-bin.jar:$ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar::$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/t_followup_0_1.jar: myproject.t_followup_0_1.t_followup --context=Default "$@"
The file is getting executed as per the schedule but the ETL is not happening...
The respective files are present in the respective directories as per the code.. Can any one tell me what is to be changed in the code in order to run the ETL... Is there anything to be changed in -> cd `dirname $0`