• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Loadjava program

 
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I have a Java class that will read the files and insert some data in the database. Currently by using loadjava command we loaded the class in the schema. Noe that class is running on the Oracle JVM(on the server). But my requirement is to pass the file from the Local machine(Ex: C:\test.txt). But the java class running on the server is searching the file in the server and throwing file not found exception.

Please assist me to resolve the issue.
 
Marshal
Posts: 80281
432
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please Carefully Choose One Forum. Moving to our databases forum.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The answer seems obvious: either upload the file to the server, or run the Java class on the client where it has access to the file. Am I missing something?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apache commons is the best option to upload the file to the server ? or any thing else
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That depends on what kind of access you have to the server- HTTP, WebDAV, FTP, shared directory, something else?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
simple FTP
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Then the Apache Commons Net library would indeed be a good choice.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Apache Commons Net library is not suitable for my requirement. Could you please assist me with some other FTP. I just want to copy the file from the client machine to unix server.

 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Apache Commons Net library is not suitable for my requirement.


Why not? What is your requirement? If you want to upload a file programmatically to a machine to which you only have FTP access, then you will need to use an FTP library, no?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Am unable to load the commons-net-1.4.1.jar in the schema. This jar depends on lot of jar.

am unable to find all the dependent jars.


Java class is running in the unix machine. I have

IP address
login user
login pwd of the unix machine.

How to transfer a file from a client(windows machine) to unix server where the java is running.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Am unable to load the commons-net-1.4.1.jar in the schema.


What does "in the schema" mean? You seem to use that term to indicate that the code is running as part of the server; is that correct? If so, that is the wrong place for this code: Commons Net would be used for implementing the FTP client that connects to the FTP server that you said was available on the server already.

This jar depends on lot of jar. am unable to find all the dependent jars.


Try harder. The error messages you'll get for missing classes provide excellent clues.
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf,

My java code is not runing on the client Machine. It's running on the ORACLE JVM I load the java class in the schema using loadjava command.

So now the code is running in the Oracle JVM which inside (Unix machine). Now I need to transfer the file from the windows machine to Unix machine.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's take a step back. You have a file that you want to transfer to a server that is only FTP-accessible (at least that's what you said in your 3rd post). In your 5th post you're indicating that you have a username/password for login - do you mean Telnet by that, or SSH, or FTP?

Also, do you want to transfer the file manually or programmatically?
 
Meet Gaurav
Ranch Hand
Posts: 492
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to transfer the file programmatically.

Basically Server denote my Unix box. We can't transfer a file with out authentication(userid, pwd) rite.
 
Bartender
Posts: 2662
19
Netbeans IDE C++ Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have done this before using ANT scripts.

First the ANT FTP task to upload a file,
then the ANT TELNET task to call the command to process the file on the server.

 
Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Meet Gaurav wrote:I want to transfer the file programmatically.

Basically Server denote my Unix box. We can't transfer a file with out authentication(userid, pwd) rite.



As far as I understood you must use your ftp stuff on your client side, so no need to embed ftp client library on oracle using loadjava.

On client machine -either linux or windows- the simpliest way that comes in my mind is to use a some peice of shell script to make ftp to database server. Then you can use utl_file to access it within your database.
 
No matter. Try again. Fail again. Fail better. This time, do it with this tiny ad:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic