If you rely on simple FTP protocol, you can use two main approaches:
- Build a Java procedure to run shell scripts (with a PL/SQL wrapper), like the one available here, and invoke a third party FTP software. This option has the advantage of less code to manage, but of course, you will have to depend on third party software, which depending on your application's context may be an unwanted feature.
- Develop a pure PL/SQL package to send and receive files. Using the UTL_TCP and UTL_FILE packages, you can easily implemente a FTP API. Even easier is using an already implemented API, like the one available on Oracle-Base and the XUTL_FTP package. You may find more examples throughout the Oracle Bloggers or on the OTN network.
First of all, do not confuse SFTP with FTPS. SFTP is based on the SSH protocol, and is called SFTP simply merely to "marketing techniques" by the SSH group. FTPS is the secure version of the original FTP protocol.
In my case I was called to implement a SFTP API for the database. Well, the lack of PL/SQL infrastructure to do so I turned to JAVA! Using the ChannelSFTP class of the JSch package, I easily implemented a simple API to send and receive files via SFTP.
Finally with the .jar deploy I loaded my package to the Oracle database (after loading the JSch jar and the Jzlib jar) and build the PL/SQL wrappers.
The first battery of tests demonstrated: success! SFTP from the database!
In conclusion, Oracle's architecture allows multiple solutions to a problem, and with Java there's always a way out!
If you want the code for the Java SFTP API or/and PL/SQL wrappers fell free to email me.
80 comments:
Well the law of Murphy is stone written and a bug has been found: when calling the java api from within the Oracle database, the send function stops at about 128k..This only happens inside the database, which alone is a scary fact :\
When I figure it out, I'll post a solution...
Was wondering if you got your SFTP package working in a production environment without the data transfer limit.
J.Zimmerman indeed not...the project got pushed off for the time being..but I should get around and test it around this holiday season...so expect new news soon...I'm way overdue on some posts...
Hi Pedro,
I following this interesting blog and just curious if you got the sftp package working without the limit (data transfer).
Congratulations and thank you! Atleast it gives me a lot of heart to explore this option.
Hi pedro
can you please send SFTP code for Oracle with Java classes.
my email batchuusa@yahoo.com
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
my email mbenitezcol@hotmail.com
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
my email igorl45@optonline.net
Thank You for your article. It helped me to choose the API (JSch).
I implemented the functionality myself. At least"put" command seems to function correctly even with >1mb files.
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is devendrasaraswat@yahoo.com.It will be a great help for me.
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is devendrasaraswat@yahoo.com.It will be a great help for me.
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is chris.talbot@talktalk.net.It will be a great help for me.
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is mattijussi.piirainen@gmail.com.It will be a great help for me.
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is cschandu20@gmail.com.It will be a great help for me.
Hi Pedro,
Could you let me have the code you mention you used for the SFTP/FTP?
Thanks,
Simon
si_g_palmer@yahoo.com
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail is ROALEXANDER@gmail.com.It will be a great help for me
Hi Pedro,
Please provide a SFTP code using pl/sql and JAVA. My mail id is tsyuen@aol.com.It will be a great help for me.
Hello,
Could you send me the code with pl/sql and JAVA?
Do you have pl/sql version only?
My email is lia_1232000@yahoo.com
Thanks a lot.
Hi ,
Could you send me your code - java and pl/sql?
Do you have pl/sql version only?
My email is lia_1232000@yahoo.com
Thanks a lot.
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes and also please expain me the steps to be followed to do SFTP from Oracle since I am not much comfortable with Java.
my email id : narsamanil@yahoo.com
Thanks in advance.
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
my email junxi.guo@coghlan.com.au
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
thanks a lot
mail: airedostana@gmail.com
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes
Thanks,
Evan Todd
Oracle DBA
ewtodd@saclink.csus.edu
Hi Pedro,
Can you please send me your SFTP code, including PL/SQL wrapper, java classes, etc.?
bigdawg@anet.com
Thanks,
Ron
Hello Pedro,
Can you please provide me the SFTP code for Oracle with the java classes I will have to load into the database and the PL/SQL wrapper and how to execute it from within the database.
Much appreciated.
Hi pedro
Please, can you send SFTP code for Oracle with Java classes.
my email paolo.de.rossi@libero.it
Thanks
Hi Pedro,
Can you please send me your SFTP code, including PL/SQL wrapper. Thanks for all your work.
noel.sultana@tafensw.edu.au
Thanks
Hi Pedro,
Can you please send me the java and plsql code for the SFTP process,
My e-mail is arammard@aol.com
Thank You,
Hi Pedro,
Could you send me your code - java and pl/sql? My mail id is andr.schneider(at)web.de.
It will be a great help for me.
Thanks!
Andreas
Hi Pedro,
Can you please send me the java and plsql code for the SFTP process,
my email: masu@seznam.cz
Thank
Marcel
Please send me the sftp code at salagirisamy@gmail.com
Hello
Can you please send me the java and PL/SQL code for the SFTP process. Did you use any Shell scripts for this process?
My email: varpra@yahoo.com
Thanks
Hi Pedro
Have you fixed the issue with the data limit? If so, can you please send SFTP code for Oracle with Java classes?
my email wcdba13@yahoo.com
Can you please send me the java and PL/SQL code for the SFTP process?
Email: ashokit@eyeteaworld.com
Thanks
Ashok
Hello Pedro
Can you please send me the java and PL/SQL code for the SFTP process.
My email: redvries[at]gmail.com
Thanks
Can you please send me the java and PL/SQL code for the SFTP process.?
My email: cosiced@gmail.com
Hello,
Can you mail me the code ?
Regards,
Robert
rasmh@hotmail.com
Can you please send me the java and PL/SQL code for the SFTP ?
email id: jai.oracle@gmail.com
Thanks & Regards,
Jai Ganesh
Can you please send me the java and PL/SQL code for the SFTP ?
flavio.meneghetti@gmail.com
Thanks,
Flavio Meneghetti
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
thanks a lot
mail: shyamals@pulsenetworks.com
shyamal_1983@yahoo.com
1983.shyamal@gmail.com
Hi pedro
Please, Can you send me too SFTP code for Oracle with Java classes.
My email : Mirwan_Rusan@yahoo.com
thanks a lot
Hi Pedro,
Appreciate if you can send SFTP code for Oracle with Java classes.
my email dino_teoh66@yahoo.com
Thanks!
Hi Pedro,
would be great, if you can provide me your code...
email: donthendl@yahoo.com
Best Regards.
Hi Pedro,
Can you please send me the java and plsql code for the SFTP process,
My e-mail is et62962003@gmail.com
Thank You,
Hi,
Can you please email me code?
ankit.parab@gmail.com
Thanks,
AP.
Hi Pedro,
interesting blog.
Can I get the code for the SFTP package for Oracle?
geert.van.lier@home.nl
Hi, could you please send me the code for SFTP for Oracle?
olgfvikh@gmail.com
Thanks
Could you please send me the SFTP code for Oracle.
Email: nvvijaya@gmail.com
Thanks
Hello,
Can you mail me the code ?
Regards,
Flavio
flavio.meneghetti@gmail.com
Hi Pedro,
Can you please send me the java and plsql code for the SFTP process,
My e-mail is jim_naka@hotmail.com
Thank You,
Hi,
Can u please mail me the code at
akdasshaikh866@gmail.com
Anonymous said...
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
my email januardi@gmail.com
Hola , por favor enviame el codigo SFTP, de ante mano muchas gracias
jorgemolinacabezas@gmail.com
Hi pedro
Please, Can you send SFTP code for Oracle with Java classes.
asis1980@gmail.com
Hi Pedro,
Could you please send me the code to my email address : gajanan.bait@gmail.com
Thanks
Gajanan
Hi Pedro
Please can you provide SFTP code for Oracle with Java classes.
Email ID: mithoo.mith@gmail.com
Thanks in advance.
Hi Pedro
Could you send me your code - java and pl/sql? My mail id is luisfcastilla@gmail.com
It will be a great help for me.
Thanks!
Felipe,
Hi Pedro
Please mail me the code files
Email ID is nagesh.pabolu@gmail.com
Thanks,
Satya
Hi Pedro,
Please email me the code files.
My email address is vmorneau@insum.ca
Thanks,
Vincent
Hello Pedro.
I to would be interested in seeing the example code.
thelfter@gmail.com
Hello
Can you please send me the java and PL/SQL code for the SFTP process. Did you use any Shell scripts for this process?
My email: ashfi60@gmail.com
Thanks
Please, Can you send SFTP code for Oracle with Java classes. Thanks.
Vadim
av@kanet.ru
Hi Pedro
Can you please send me the java and PL/SQL code for the SFTP process
My email is danivos92@gmail.com
Thank you very much
Daniela :)
Hi pedro
Can you please send me the java and PL/SQL code for the SFTP ?
santhoshbla@gmail.com
Thanks,
Santhosh L
Hi Pedro
Can you please send me the java and PL/SQL code for the SFTP process
My email is luisjramos29[at]gmail.com
Thank you very much
Luis J
Hi pedro
Can you please send me the java and PL/SQL code for the SFTP ?
ramirez.mynor@gmail.com
Thanks,
Mynor RamÃrez
Hi, Pedro
can you please send SFTP code for Oracle with Java classes.
my email shilovmv@gmail.com
thanks
Hi Pedro,
could you please send me a copy of your Java SFTP API and PL/SQL wrappers? Much appreciated!
xiang.xiao@nielsen.com
Hi Pedro,
Would like to request the SFTP code.
Thanks
jbw . jbw @ gmail . com
Hello Pedro.
Could you please send me SFTP code (package and java) ?
jrquinte@hotmail.com
Regards
Hi Pedro,
Can you please send the code to me as well.
jjodha@cargojet.com
Good Morning Pedro,
Can you please send me the java and PL/SQL code for the SFTP ?
Regards, eescalanteba@hotmail.com; eescalante.rosales@gmail.com
Good Morning Pedro,
Can you please send me the java and PL/SQL code for the SFTP ?
Regards, eescalanteba@hotmail.com; eescalante.rosales@gmail.com
Hi Pedro,
Can you please send me the java and PL/SQL code for the SFTP to klokov9@gmail.com?
Thank you,
Anatoliy
Good Morning, Pedro
PLease, can you send me your java and PL/SQL code for the SFTP to this email: kakarottobcn@hotmail.com ? It will help me a lot
Thank you
Jordi
Hi Pedro,
Can you please send me the java and PL/SQL code for the SFTP to valdirsantiagoaraujo@gmail.com ?
Thank you,
Valdir Araujo
Hi Pedro,
Can please send me java and PL/SQL code for the SFTP?
Email address : kaylynchew8@gmail.com
Much Appreciated.
Thank you
Hi Pedro,
Can please send me java and PL/SQL code for the SFTP?
Email address : tsvidap@gmail.com
Much Appreciated.
Thank you
Hi Pedro,
Can please send me java and PL/SQL code for the SFTP?
Email address : tsvidap@gmail.com
Much Appreciated.
Thank you
Post a Comment