Data type mismatch error: java.utill.date

Four Stars

Data type mismatch error: java.utill.date

Hi,

Im trying to load data from SQL server db but unable to do so because this below error.

Any thing that would help is appreciated

Thanks


Accepted Solutions
Sixteen Stars

Re: Data type mismatch error: java.utill.date

I *think* I know what it is. Your job is called Date. Your job is essentially a Java class. Change the name of your job and I believe this will fix it.


All Replies
Twelve Stars

Re: Data type mismatch error: java.utill.date

@Aravind_M,could you please check what date format do you have in DB?

Manohar B
Four Stars

Re: Data type mismatch error: java.utill.date

@manodwhb 

Thanks for the reply,

I have the format in both the dbs as yyyy-mm-dd 

 

Twelve Stars

Re: Data type mismatch error: java.utill.date

@Aravind_M,but i see "dd-MM-yyyy' in row1 shema? please check that could be the issue.

Manohar B
Four Stars

Re: Data type mismatch error: java.utill.date

@manodwhb 

Oh!! I was just trying out different formats, I could have not changed it while taking the screenshot

I have changed it my job anyways but still the same error persists


@manodwhbwrote:

@Aravind_M,but i see "dd-MM-yyyy' in row1 shema? please check that could be the issue.


 

Twelve Stars

Re: Data type mismatch error: java.utill.date

@Aravind_M,just extract the data from sql server and write it to tlogrow to check the data how are you getting Talend.

Manohar B
Four Stars

Re: Data type mismatch error: java.utill.date

talend2.JPGcorrect formate of date is observed here tootalend1.JPGhas this driver got something to do with this is?

Twelve Stars

Re: Data type mismatch error: java.utill.date

since you need to install mssql-jdbc.jar from screenshot,can you install that?

Manohar B
Four Stars

Re: Data type mismatch error: java.utill.date

That didnt work either @manodwhb

Sixteen Stars

Re: Data type mismatch error: java.utill.date

Don't worry about Date formats unless your database is storing your date as a String. Dates are essentially numbers. Formats are just representations of those numbers. The ONLY time you need to worry about formats is when you are translating from a String to a Date or when you are wanting to represent a Date as text.

You have not given enough information here to see the issue. It is a compile time issue which means your generated code will show where the error is. In the bottom left corner of your workspace, you will see a Code tab. Click on it. It will take a while to generate the Java code for this job. When it completes you will see yellow and red boxes along the right side of the code. You can ignore yellow boxes as warnings (you won't get rid of those and they cause no harm). You need to look for red boxes. They will stop the job compiling AND (this is important) point you towards the actual issue. Click on the red boxes and it will take you to the code that is broken. Take a screen shot of the broken code and post it. That will help us identify this. 

Four Stars

Re: Data type mismatch error: java.utill.date

please check the errors in the attached files. 

Eight Stars

Re: Data type mismatch error: java.utill.date

Then do one thing. use TalendDate.formatDate and ParseDate. Basically will convert from Date to String and ParseDate will convert that String to Date. One thing u check first is printing that Date column in your tlogrow of a Test Job.also check carefully in the Target DB what is the column Format or DataType. This is a Compile Time issue. 

Sixteen Stars

Re: Data type mismatch error: java.utill.date

I *think* I know what it is. Your job is called Date. Your job is essentially a Java class. Change the name of your job and I believe this will fix it.

Four Stars

Re: Data type mismatch error: java.utill.date

Thanks @rhall_2_0  

perfect!!