Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

file export  RSS feed

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My application generates a log file.
1. I want to export the file to different machine. How can i do this?
2. If i have log messages logged into a data base table how can i export the file to different database?
Please help me, as it is very urgent during my project.
Thanks in advance,
kiran
 
Ranch Hand
Posts: 1879
MySQL Database Suse
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by satya kiran:
My application generates a log file.
1. I want to export the file to different machine. How can i do this?
2. If i have log messages logged into a data base table how can i export the file to different database?
Please help me, as it is very urgent during my project.
Thanks in advance,
kiran


1: Read the log file in line by line using FileReader/BufferedFileReader and write it out line by line using PrintWriter/FileWriter/BufferedFileWriter classes.
2.
for more details on #1 see the java.io docs or java.io tutorial and for more information on #2 see the jdbc docs or jdbc tutorial
Jamie
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question seems somewhat vague to me. My first answer is to simply copy the file to a disk or across the network. However, I doubt that is what you are really asking.
If the machines are connected with a LAN and the other machine is mounted to the machine where you are running your program, you can simply create a file on the other machine using the local operating systems naming convention. Under Windows, the network drive is usually given a drive letter. Under various Unix flavors, the remote machine is mounted as a directory.
If you can't do the above, you may need to use the URL class to access the other machine over the internet. I don't know all the details here, but you can easily look them up in the Java API docs.
HTH
Layne
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!