Using java to create a file?

hi there
I just have a question regarding the creation of a file using PrintWriter class.:
FileOutputStream fileOutputStream = new FileOutputStream(outFileName);
PrintWriter out = new PrintWriter(new OutputStreamWriter(fileOutputStream, encoding));
after the file is being created, do I need to set out to null. because I was not able to move or modifiy the file while the program is running.
thank you for your help.

to null. because I was not able to move or modifiy the
file while the program is running.
thank you for your help.that is because the program locks the file.

Similar Messages

  • Error Using OEM to create export files

    Hi
    I get the following error whenever I try to use OEM to create export files (login to OS as oracle user -> http://localhost:1158/em -> login as SYSTEM -> Maintenance -> Export to Export Files (with oracle user as host credentials)
    >>>
    Validation Error
    Examine and correct the following errors, then retry the operation:
    Error - ERROR: NMO not setuid-root (Unix-only)
    >>>
    From what I've read in this forum and in others is that the problem is often related to the owner/group permissions associated with the bin/nmo and bin/nmb files. However I've tried the posted solutions by changing the owner/permissions as suggested, but this does not help. I get the same error regardless if the files are owned by oracle or by root.
    Here is some more info
    >>>
    [root@rhlinux bin]# id oracle
    uid=501(oracle) gid=502(dba) groups=502(dba)
    [root@rhlinux bin]# ls -ld /app/
    drwxr-xr-x 4 root root 4096 Jul 6 13:36 /app/
    [root@rhlinux bin]# ls -ld /app/oracle/
    drwxrwxr-x 5 oracle dba 4096 Jul 10 10:13 /app/oracle/
    [root@rhlinux bin]# ls -ld /app/oracle/product/
    drwxrwx--- 3 oracle dba 4096 Jul 6 16:04 /app/oracle/product/
    [root@rhlinux bin]# ls -ld /app/oracle/product/v10.2.0/
    drwxr-x--- 58 oracle dba 4096 Jul 11 15:31 /app/oracle/product/v10.2.0/
    [root@rhlinux bin]# ls -ld /app/oracle/product/v10.2.0/bin/
    drwxr-xr-x 2 oracle dba 8192 Jul 20 11:19 /app/oracle/product/v10.2.0/bin/
    [root@rhlinux bin]# ll nm?
    -rwxr-x--- 1 root dba 18462 Jul 6 16:16 nmb
    -rwxr-x--- 1 root dba 19624 Jul 6 16:16 nmo
    >>>
    >>>
    [oracle@rhlinux bin]$ uname -a
    Linux rhlinux 2.6.9-34.0.2.EL #1 Fri Jun 30 10:23:19 EDT 2006 i686 i686 i386 GNU/Linux
    >>>
    >>>
    [oracle@rhlinux bin]$ sqlplus system@dware
    SQL*Plus: Release 10.2.0.1.0 - Production on Thu Jul 20 16:34:16 2006
    Copyright (c) 1982, 2005, Oracle. All rights reserved.
    Enter password:
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
    With the Partitioning, OLAP and Data Mining options
    >>>
    >>>
    [oracle@rhlinux bin]$ emctl status agent
    TZ set to Canada/Saskatchewan
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    Agent Version : 10.1.0.4.1
    OMS Version : 10.1.0.4.0
    Protocol Version : 10.1.0.2.0
    Agent Home : /app/oracle/product/v10.2.0/rhlinux.swlocal_DWARE
    Agent binaries : /app/oracle/product/v10.2.0
    Agent Process ID : 32098
    Parent Process ID : 30792
    Agent URL : http://rhlinux.swlocal:3938/emd/main
    Started at : 2006-07-20 12:00:05
    Started by user : oracle
    Last Reload : 2006-07-20 12:00:05
    Last successful upload : 2006-07-20 16:27:29
    Total Megabytes of XML files uploaded so far : 1.54
    Number of XML files pending upload : 0
    Size of XML files pending upload(MB) : 0.00
    Available disk space on upload filesystem : 47.83%
    Agent is Running and Ready
    >>>
    >>>
    [oracle@rhlinux bin]$ emctl status dbconsole
    TZ set to Canada/Saskatchewan
    Oracle Enterprise Manager 10g Database Control Release 10.2.0.1.0
    Copyright (c) 1996, 2005 Oracle Corporation. All rights reserved.
    http://rhlinux.swlocal:1158/em/console/aboutApplication
    Oracle Enterprise Manager 10g is running.
    Logs are generated in directory /app/oracle/product/v10.2.0/rhlinux.swlocal_DWARE/sysman/log
    >>>
    Any other ideas what might be causing this problem?
    Thanks and take care,
    Shayne

    From what I've read in this forum and in others is
    that the problem is often related to the owner/group
    permissions associated with the bin/nmo and bin/nmb
    files. However I've tried the posted solutions by
    changing the owner/permissions as suggested, but this
    does not help. I get the same error regardless if the
    files are owned by oracle or by root.
    I am not sure which "posted solutions" you had, but this is related to not running root.sh which must be run against the Agent Home.
    1. Stop the Agent (emctl stop agent) while connected to the OS as Oracle user (normally oracle) that installed Grid Control
    2. Connect to the OS as root and run root.sh from Agent ORACLE_HOME (if you do not have root access, your System Admin can do it)
    3. Start the Agent (emctl start agent) while connected to the OS as Oracle user

  • Using MDAB to create Planning file

    Hello,
    I noticed that for some materials, there is no entry in the planning files.
    How can I use MDAB to create planning file entries for specific materials? Can I specify the name of materials?
    Please help me out with this issue.
    Sincerely,
    Ketan

    Hai,
       If u activte planning file entries in back ground ur system take care about creating planning file entries automatically. For those materials which are Having MRP type other than  ND.
       If ur MRP type is ND then there is no Entry in Planning file.
    I hope this may solve UR prob
    KM

  • How to generate reportdesign dynamically using java with out xml file

    hi
    how can i generate a reportdesign dynamically using java with out passing xml file to jasperDesign , i want to create my reportdesign with out xml file
    how can i ,please help
    thanks

    LiveCycle does provide a Java API to forms; LiveCycle is in fact a suite of programs, mostly enterprise level for running on server (next to which the cost of the master suite is a drop in the ocean). LiveCycle Designer is perhaps the only end user tool, and it is not for server use and doesn't have an API.
    Are you looking for a server solution? If so, nothing in the master suite can help, it isn't for server use.

  • How can I use a manually created help file

    Is it possible to use a manually crated help file *.hlp (microsoft help file) in a oracle forms application.
    I want to open the help file from in my help menu. How can I do that??
    Joury

    Hi,
    Have you tried WIN_API_SHELL.winhelp and WIN_API_SHELL.winhelpex?
    Both are available in D2KWUtil.PLL, usually included in Forms demos.
    Pedro
    null

  • Using Pages to create epub file??

    Why when I export from pages to an epub file does it change the layout (i.e. moves part of page 2 to page 3 and then continues on like that?)
    I'm trying to publish a book of poetry on ibooks but it keeps messing with the format?

    Howdy trentharris,
    Documents created in Pages and exported as ePub may look different when displayed. The following article explains this and gives some tips for best practices to reduce the differences -
    Pages '09: Creating an ePub Document to Read in iBooks
    Thanks for using Apple Support Communities.
    Best,
    Brett L 

  • Xcelsius XML Connection Issue when using a Crystal created XML file

    HI Xcelsius/Crystal Gurus,
    I am running Crystal Reports 2008 version 12.2.9.698 and Xcelsius 2008 5.3.0.0 Build 12,3,0,670,
    I am attempting to create an XML file from a Crystal report which will be consumed by an Xcelsius Dashboard.  Apparently, there is something with the file that Xcelsius does not like.
    I have formatted the report exactly as Xcelsius requires and exporting via text with an xml extension to create an .xml file.  When I add an XML Connection in Xcelsius and add the appropriate names/range, etc...I am able to see the file via the Preview XML button on the Connection, but when I use a component, I am not seeing the data in the component.
    I can 'recreate' the file in NotePad by manually typing in the entries to look exactly like the file created by Crystal and set up a connection in Xcelsius to consume that file and it works beautifully.
    Does anyone have any experience with using Crystal Reports to create an XML file (not using the XML Export, but by exporting as a Text and adding an extension)?
    Is it possible that Crystal is adding hidden characters or something?  I can pull this Crystal created file into an XML editor or MS Word and it is validated as a good XML File.
    Any help is greatly appreciated!

    This article is all about setting up security on the web service. But, I just want to connect to the web service as a client using the proxy and the web service doesn't have any security set on it at this time.
    I am getting a connection timeout, even when I set the syncMaxWaitTime in the domain.xml file on the app server to a higher number (although this doesn't seem to affect the time it takes for the debugger to return).

  • Java not creating .class file ?

    I copied and pasted text into textpad then saved textpad creats the java file but no class file ! What gives ? I tried rebooting , the class name is the same (not mispelled) even did a HD search for class file and its no where to be found

    You have to compile a Java source file into a class file.
    http://java.sun.com/docs/books/tutorial/getStarted/cupojava/win32.html

  • Anybody know how to use jave work with mapping file? help!

    mapping file are somehow those...
    <db-insert root-element>
    .....<map-info>
    something like that, and I dont know how java code can use with them..my database is mysql...
    or any reference site is good.?
    Thank you very much

    urm...thanks..
    my job is about to write a transformation tool to transform XML documents into a database. The tools is written for users to extract data in XML format and store it into a database. But i would choose MYSQL. Mapping files are used to store information correctly into database to avoid the need to write new code for each type of XML files. And can choose any programing langugage for implementation such as Java and C#.........and currently still looking on Java or VB

  • Is it possible to use JTrees to create a File Manager??

    -- I'm wonderin on how can i use JTrees to view my entire system file...
    i want to create a FileManager apps wherein you can navigate your file system like navigating a windows explorer....
    Thanks

    You can in fact I once did it.
    All you have to do is to define a root node class which will have all the Directory roots as its childs.
    And another node class that represents a file or a folder in the disk.

  • Mapping to an IDOC using an externally created XSL file

    I want to map a message to an IDoc using an ABAP XSLT transform. I am creating the XSLT in an external tool.
    I need to use an XSD definition of the IDOC as the target document of the mapping. I can get that in two ways:
    1) Get the XSD definition of the IDOC from transaction WE60 and use the menu command 'Documentation -> XML Schema'
    2) In the Integration Repository, export the XSD of the imported IDOC.
    The problem is, there are significant syntax differences between these versions, and I don't know which is the correct version. For instance, the XSD exported from the Integration Repository has a mandatory attribute 'SEGMENT' for each segment that must be filled to create a valid XML message; this is not the case when the XSD definition is created in WE60.
    Can somebody advise which is the correct version to use?

    Hi Anthony,
    This is really strange...
    In both case XSD should be same...can you please tell for which idoc you are generating xsd?
    Eventhough if you generate XML Schema using WE60,  mandatory attribute 'SEGMENT' for each segment has to be there....this validation would be done while posting idoc. It will check for all mandatory fields.
    I have some different thoughts that what wojciech has suggested...
    "If were your shoes I would use xsd from integration repository because that's the expected result...."
    But final goal is not to achieve mapping but posting idoc with proper data in R/3 system successfully.
    Your second question..
    "Do I assume then that placing a constant value of 1 in the SEGMENT attribute is just to satisfy the validation of the XML message against the XSD:..?
    ummm...I think if you assign constant "1" to segment it will generate that segment while creating idoc. Its mandatory to assign constant value to segment which you want to generate...
    "Can I assume that the IDoc adapter will fill the SEGMENT attribute with the correct value?.."
    I dont think so Idoc adapter will fill this attribute automatically...you need to assign constant to field segment.
    Nilesh

  • How to use java to create an XML document from an SQL database?

    Hi,
    I'm a complete novice at XML and have only recently started programming in Java.
    I'm currently trying to develop a package in Java 1.1.8 which requires a set of very specifically formatted XML documents. These documents would need to be updated regularly by people with no knowledge of Java and I would like to make it as simple as possible.
    Since the data will already be in an SQL database, I thought it might be possible to generate the XML documents from the data using a small Java application, but I'm not too sure how to go about this or if this is even possible! Any help or pointers in the right direction would be very much appreciated.
    Louise

    Do you have the option of upgrading to a newer version of the JDK?
    JAXB does what you are wanting very easily. Also there are tools if you don't want to write your own. JAXB is available as early release on Sun's site as is the newest JDK. Otherwise, you have to design a factory and interface that will do this for you (which is what JAXB basically is in a very simplified view).

  • Quiz using Java Script and XML file

    Hi,
    I am student from Liverpool in the UK. I am currently making a "quiz" website that links to an xml document, and brings back results of how the user has done.
    I have made the website, and linked it to the xml document, but I can't get javascript to tell the user how many answers they got correct. Can you help me?
    A friend told me to use a function, and then link that function to a box that, when clicked, brings up an alert box telling the user how many they got correct.
    I know this is probably very simple, but I would be very grateful for help in which exact commands to write that will bring up an alert box when the user clicks on a "Submit" button. This alert box should bring up how many correct answers (out of 10) the user obtained.
    Thanks for your time,
    Matthew Tickle.

    Java and Javascript are completely different. You probobally wont get much here... maybe u should try to find a javascript forum or look at some tutorials: http://tutorials.findtutorials.com/index/category/20

  • Use installshield to create setup file from mvc web service

    I need help from gurus :)
    I have an mvc web service and I need to create a setup package with installshield but I don't know how to do it.
    I want create setup to install at another machine (under IIS)
    Can someone help me please?
    Thanks in advance.

    Hello,
    Welcome to MSDN forum.
    Your issue is out of support range of VS General Question forum which mainly discusses
    the usage of Visual Studio IDE such as WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Because you want to use InstallShield which we don't provide support, I suggest you to consult your issue on InstallShield forums for better support.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using Compressor to create QuickTime file for Web

    Have: a 2 minute clip, shot in HD, edited in FCP7. Exported it as a FCP QuickTime movie, 1080i60, size is 441MB.
    Need to: take that QuickTime file into Compressor and create a much smaller file, which will ultimately be converted to Flash and posted on a Web site. Have tried various QuickTime outputs in Compressor -- the resulting files are either too large, blurry, or lose the widescreen aspect ratio.
    Please, help.

    Here's what I would try:
    QuickTime Movie: h.264 compression @ 1500 Kbps
    Screen Resolution: 640 x 360.
    Audio: AAC @ 128 Kbps.

Maybe you are looking for

  • Mini display port to HDMI adapter

    imac osx Tiger 10.4.11: I attached Mini-DVI to DVI cable to DVI-D to HDMI cable to Sony Brava HDMIl TV.  To use TV as monitor. The only picture is my Desktp/screensaver MINUS the Dock. I tried applications ie. calendar, textEdit; iPhoto, but nothing

  • Accessing iTunes Store keeps causing my iTunes to shut down on PC

    I have just installed an upgrade on my PC to Windows 8.1. While iTunes seems to be working, when I click on the Store menu it causes iTunes to shut down. I can access iTunes on my devices. Is anyone else having this problem? I've also tried reinstall

  • Flash CS3 Remoting

    Hi to all, I have some questions about actionscript 3 in flash cs3. I'm a developer and I develop application and website in c#, flex, and flash. Currently I would like to port some complex website to flash cs3. Why in actionscript flash cs3 there is

  • Runtime eror in IPC JSP PAGE

    Hi We are using CRM5.0 and AP7.00. We are getting error while displaying the JSP page sometimes. Let me give u feedback on the reason. We have a V-table Say TAB1 with 3 characteristic in it. This V-table is used in 2 different Models(2 Kmats). KMAT1

  • Failed to start  "admin server" and "BI publisher" :  Reason java.io.IOException openWallet

    Hello, I need your help to fix a critical problem to start Admin server and BI server : # ...domains/bifoundation_domain/bin/startWebLogic.sh .... Failed with 17-Mar-2015 17:17:33 oracle.security.jps.internal.credstore.ssp.CsfWalletManager openWallet