prtintWriter not working

hi i have this piece of code which i intend to run in thru rmiregistry      
there is no error in the compilation however no file is being created here..I wonder why???

--------------------------


public void saveUser(UserProfile currProfile) throws FileNotFoundException,IOException,RemoteException
      {
              
              PrintWriter outs = new PrintWriter( new FileWriter( "z:\\cs310\\assn5\\userprofiles.txt" ) );
                  
                  
              save2DB(currProfile,outs);

      }
      
      private void save2DB(UserProfile currProfile, PrintWriter pp) //local helper function
      {
      
                  System.out.println(" WRITING ");
                  pp.println("bah")
                  pp.println(currProfile.getName()+ "," + currProfile.getLoginID()+ "," + currProfile.getPassword()+ "," + currProfile.getEmailAddress()+ "," + currProfile.getPhoneNumber()+ "," + currProfile.getUserType());
                  
                  pp.close();
                  System.out.println(" FIN WRITING ");
                  
            
            
      }

tom_mkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

objectsCommented:
PrintWriter fails silently, call pp.checkError() to see if there was a problem.
0
petmagdyCommented:
make sure that the directory is created and have write access try this:

        File file = new File("c:\\tempo\\userprofiles.txt") ;  
        PrintWriter outs = new PrintWriter( new FileWriter( file ) );
0
tom_mkAuthor Commented:
but, even though the file does not exist, the printWriter just going to create it for me..right?
0
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

objectsCommented:
yes if it has permission to.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
petmagdyCommented:
yes but the directory must be created and have write access and use my way which is:
    File file = new File("z:\\...\\userprofiles.txt") ;
        PrintWriter outs = new PrintWriter( new FileWriter( file ) );
0
tom_mkAuthor Commented:
how can i have the write access?
0
petmagdyCommented:
please try ur code on local Harddisk first if works contact the share owner asking for write access
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.