ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Writing to file

Post new topic  Reply to topic
 Writing to file « View previous topic :: View next topic » 
Author Message
sudeepm
PostPosted: Tue Feb 19, 2008 8:49 pm    Post subject: Writing to file Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

Can some body tell me how can i write to file using java compute node.

we are not using file extender instead we need to use java compute node
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Tue Feb 19, 2008 9:20 pm    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi sudeepm,

Use Java FileWriter APIs, though I don't understand why you are reinventing the wheel and not using the file extender nodes...

Regards.
Back to top
View user's profile Send private message Send e-mail
sudeepm
PostPosted: Tue Feb 19, 2008 11:36 pm    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

we are using extender as it has some issues related to performance

I am using this way..evn though it works. i just want to know is this the only way to do.


private void writeToFile (String text)throws IOException{
Writer output = null;

File file = new File("C:/write.txt");
output = new BufferedWriter(new FileWriter(file,true));
output.write(text);
output.write('\n');
// writer.newLine();
output.close();
System.out.println("Your file has been written");
}
Back to top
View user's profile Send private message
AkankshA
PostPosted: Wed Feb 20, 2008 12:43 am    Post subject: Re: Writing to file Reply with quote

Grand Master

Joined: 12 Jan 2006
Posts: 1494
Location: Singapore

sudeepm wrote:
Can some body tell me how can i write to file using java compute node.

we are not using file extender instead we need to use java compute node


how about using a trace node for writing to a file instead of JCN
_________________
Cheers
Back to top
View user's profile Send private message Visit poster's website
sudeepm
PostPosted: Wed Feb 20, 2008 1:30 am    Post subject: Reply with quote

Acolyte

Joined: 31 Jan 2008
Posts: 57

I need to change the file name dynamically ..there should be a new file as the date changes.

we cannot do that in trace node
Back to top
View user's profile Send private message
EddieA
PostPosted: Wed Feb 20, 2008 9:09 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

sudeepm wrote:
we cannot do that in trace node

But you can write a file from the Trace Node, and then use a utility, fired off each day, to "rotate and trim" the file.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Feb 20, 2008 9:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Use v6.1 and the FileOutput node.

Otherwise, there may indeed be many different ways to write to a file in Java.

There is no way to write to a file from ESQL, without talking to Java.

The "best" way to do this may depend entirely on very specific things that are local to your situation.
[/quote]
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Feb 20, 2008 9:15 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Use v6.1 and the FileOutput node.

Otherwise, there may indeed be many different ways to write to a file in Java.

There is no way to write to a file from ESQL, without talking to Java.

The "best" way to do this may depend entirely on very specific things that are local to your situation.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » Writing to file
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.