JDBC adapter results to a Flat File

We are using JDBC adapter with dynamic query option. The results of the query are huge (more than 2 lakh records). We save the results to a specified file on the hard disk.

We are looping through the records and appending to a string variable, which we are writing to a file. However looping through the huge list of records is terminating the session of the developer. Is there a way to spool the results of the JDBC adapter service results to a file on to hard disk directly such as the SPOOL command in SQL.

Request help in this regard
Thanks in advance
Rakesh

Rakesh,

Another nice option is instead of running the AdapterService(AS) directly in the developer,wrap AS in a flowservice and Schedule this as a job in ISAdmin/Scheduler section,this makes the work easier to some extent and saves the terminating session of Developer IDE.

HTH,
RMG.

RMG,

Thanks a lot for the reply.
More than the expiration of the session, we are looking for a solution where we can avoid looping through the results from the adapter as this could actually lead to memory problems when scheduled as in the debug mode itself, while testing this is closing the session - we are still in the testing stage.

It would be of great help if you could suggest a way to get to write the results to a flat file without looping through the results array.

Thanks and regards,
Rakesh.

Rakesh,

There is no alternate way that AS to write DB results directly to a flatfile or disk… looping is the only option,but as i said shedule the service as this prevents from closing the developer sessions and dont run directly from the developer tool.Even we have faced this situation and followed the same way.

May be otherusers can jump in this thread.

HTH,
RMG.

HI RMG…

Thanks for ur response.

I was able to solve the above issue by using the convertToString service.

I created a schema similar to output document from the Adapter results.Then i converted the recordList to record and then passed as an input variable tp ffValues and schema ( Which i created ) to ffSchema.

That did give me the string without looping through the results…

Thanks once again.
Rakesh

Rakesh,

I almost thought to say the same FFSchema solution before,but since you have asked is there any direct way pushing JDBC AS results to a flatfile/harddisk…so your query confused me not to say that WMFlatFile Adapter solution (preparing FFSchema,making FF string using convertToString etc).

Anyways you got the solution…

Cheers,
RMG.

RMG…

Sorry for the confusion!!!

Anyway … Thanks for help.

Hai rakesh
i am new to this group

i have the problem of writing flowsteps for looping through the records and appending to a string variable and writing to a file.

here we are using jdbc adapters we get the data by using jdbc adapter service
but i am not able to set the records into the flatfile

i think you can help me,please send the reply ASAP

Thanks,
Sanjeev.

Hi Sanjeev

Let me know the exact error which you are facing.
usually the process is, loop over the results and map the results to a string variable… and concat the results … then writeToFile (You can use PSUtilities.file:writeToFile).

Thanks
Rakesh

Hai Rakesh

i just reterive the data by using JDBC adapter
what i want now is to place the data into the flatfile format
can u please tell the flow steps to save that into the file

thanks
sanjeev

Hai,

i just reterive the data using jdbc adapter

i am really facing the problem with the flatfileschema

can u please help me

thanks
Sanjeev