cancel
Showing results for 
Search instead for 
Did you mean: 

FILE 2 JDBC

Former Member
0 Kudos

hi

I am working on FILE(XML) to JDBC Scenario.

Here i have to send whole file to a single field in DB.

Field type in DB is BLOB,so it can accomidate whole file,but how can i do Many to One in Mapping,hope its not possible.Let me know if any one came across to this type of scenario

Thanks

Prabhakar

Accepted Solutions (1)

Accepted Solutions (1)

prateek
Active Contributor
0 Kudos

It is possible

Regards,

Prateek

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

In addition to the above, try this...

use a java mapping to conver the input stream to string, u can use SAX parser and n the write method between the DATA xml tags call the variable.pass it to DB, should work out.

Check this

Let me know if u require qny help on the code.

Edited by: Ibrahim on Oct 19, 2008 6:35 AM

Former Member
0 Kudos

Hi Venkata

Use Normal mapping that will allow you to read a file. Normal for XML and even using FCC if require. In interface mapping use a XSLT or Java mapping to parse all the fields into one single field as a string.

Now the scenario at Interface mapping will be

 Source(n fields) -> Graphical mapping(1 to 1 or 1to1 woth additonal) -> Target (from Graphical mapping) -> Java or XSLT (Combinig fields many to 1) -> Target2 ( 1Field) for your JDBC

Check this thread for XSLT code

Thanks

Gaurav

Former Member
0 Kudos

HI Guys,

I really appreciate for your answers.But as i mentioned above i dont want to mention only fields to target BLOB.

I WANT TO WHOLE INPUT XML TO A TARGET(BLOB ).

Thanks

Prabhakar

Former Member
0 Kudos

HI Prabhakar

Yes you can try the solution provided above. You have to convert the complete XML into a string and then pass it to BLOB type field.

Thanks

Gaurav

Former Member
0 Kudos

The Link give my Prateek has the same stuff you need.

You need to use XSLT mapping and use CDATA in it,it will concatenate the whole XML payload(along with the XML tags) and send to one field.

>>I WANT TO WHOLE INPUT XML TO A TARGET(BLOB ).

Please don't use Capital letters in your post,its equivalent to shouting at other in SDN.

Thanx

Aamir

prasad_ulagappan2
Contributor
0 Kudos

Its possible through a java mapping. Java mapping can convert the full payload into a single string, which you can pass on to the target node.

Former Member
0 Kudos

In your message mapping involve the XSLT mapping to achieve the desired result.

Regards,

Sarvesh