Cannot upload file to Oracle DB using blob datatype

Hi
I am uploading a file to Oracle DB through JAVA. I am inserting the file as
a BLOB datatype. I am using JRUN 4 . But when I am uploading the file to the DB through my application it is not showing anything in the DB. The samp application is working fine on my QA environment on the same server . Is there some setting that needs to be done . Could this be a problem with the version of classes12.zip.
Also when i try to view the file it is giving me this error
ORA-06550: line 1, column 13:
PLS-00201: identifier 'DBMS_LOB' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
Please help

Not sure afterall if you mean that you are having a pblm uploading (from what kind of file BTW?) or viewing after upload?
Try these tutorials - I found them very helpful. Also, do you have the 'PL/SQL Programming' book from Oracle Press? That has an entire chapter devoted to LOB types.
[url http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/blob/blob.html] How to deploy a PL/SQL function returning BLOB as Web Service
[url http://www.oracle.com/technology/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html]LOBsample
HTH

Similar Messages

  • Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure

    Please Help , Urgent Help Needed.
    Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
    Case's are :
    1. Excel File is On Users/ Client PC.
    2. Application is on Remote Server(Oracle Forms D2k).
    3. User Is Using Application Using Terminal Server LogIn.
    4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
    5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
    6. we are Using Oracle 8.7
    So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
    Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
    Jus help to Sort This Issue ........
    you can also write me on :
    [email protected], [email protected]

    TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
    If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
    If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
    Justin

  • How To Store pdf or doc file in Oracle Database using Java Jdbc?

    can any one help me out How To Store pdf or doc file in Oracle Database using Java Jdbc in JSP/Serlet? i tried like anything. using blob also i tried. but i am able 2 store images in DB not files. please if u know or else if u have some code like this plz send that to me, and help me out plz. i need that urgent.

    Hi.. i am not getting error, But i am not getting the original contents from my file. i am getting all ASCII vales, instead of my original data. here i am including my code.
    for Adding PDF in DB i used image.jsp
    Database table structure (table name. pictures )
    Name Null? Type
    ID NOT NULL NUMBER(11)
    IMAGE BLOB
    <%@ page language="java" import="java.util.*,java.sql.*,java.io.*" pageEncoding="ISO-8859-1"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <%
    try{
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
         PreparedStatement ps,pstmt,psmnt;
         ps = con.prepareStatement("INSERT INTO pictures VALUES(?,?)");
    File file =
    new File("D:/info.pdf");
    FileInputStream fs = new FileInputStream(file);
    ps.setInt(1,4);
    ps.setBinaryStream(2,fs,fs.available());
    int i = ps.executeUpdate();
    if(i!=0){
    out.println("<h2>PDF inserted successfully");
    else{
    out.println("<h2>Problem in image insertion");
    catch(Exception e){
    out.println("<h2>Failed Due To "+e);
    %>
    O/P: PDF inserted successfully
    i tried to display that pdf using servlet. i am giving the code below.
    import java.io.IOException;
    import java.sql.*;
    import java.io.*;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
    public class DispPDF extends HttpServlet {
         * The doGet method of the servlet. <br>
         * This method is called when a form has its tag value method equals to get.
         * @param request the request send by the client to the server
         * @param response the response send by the server to the client
         * @throws ServletException if an error occurred
         * @throws IOException if an error occurred
         public void service(HttpServletRequest request, HttpServletResponse response)
                   throws ServletException, IOException {
              //response.setContentType("text/html"); i commented. coz we cant use response two times.
              //PrintWriter out = response.getWriter();
              try{
                   InputStream sPdf;
                   Class.forName("oracle.jdbc.driver.OracleDriver");
                        Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.1.135:1521:orcl","scott","tiger");
                        PreparedStatement ps,pstmt,psmnt;
                   psmnt = con.prepareStatement("SELECT image FROM pictures WHERE id = ?");
                        psmnt.setString(1, "4"); // here integer number '4' is image id from the table.
                   ResultSet rs = psmnt.executeQuery();
                        if(rs.next()) {
                   byte[] bytearray = new byte[1048576];
                        //out.println(bytearray);
                        int size=0;
                        sPdf = rs.getBinaryStream(1);
                        response.reset();
                        response.setContentType("application/pdf");
                        while((size=sPdf.read(bytearray))!= -1 ){
                        //out.println(size);
                        response.getOutputStream().write(bytearray,0,size);
                   catch(Exception e){
                   System.out.println("Failed Due To "+e);
                        //out.println("<h2>Failed Due To "+e);
              //out.close();
    OP
    PDF-1.4 %âãÏÓ 2 0 obj <>stream xœ+är á26S°00SIá2PÐ5´1ôÝ BÒ¸4Ü2‹ŠKüsSŠSŠS4C²€ê P”kø$V㙂GÒU×713CkW )(Ü endstream endobj 4 0 obj <>>>/MediaBox[0 0 595 842]>> endobj 1 0 obj <> endobj 3 0 obj <> endobj 5 0 obj <> endobj 6 0 obj <> endobj xref 0 7 0000000000 65535 f 0000000325 00000 n 0000000015 00000 n 0000000413 00000 n 0000000168 00000 n 0000000464 00000 n 0000000509 00000 n trailer <<01b2fa8b70ac262bfa939cc786f8770c>]/Root 5 0 R/Size 7/Info 6 0 R>> startxref 641 %%EOF
    plz help me out.

  • Cannot Upload File via Send?

    I have an .ai file at around 413 megs that I am trying to send through "Send", but keep getting Error: cannot upload file please try again.  Been having the same issue for a few weeks.  Anyone know file size limits or what might be happening?
    I keep having to use wetransfer.com instead which is FREE.

    Hi danldurall,
    It sounds like Send is timing out--there have been some issues with Send uploading large files, and Adobe is working on that issue. In the meantime, you're welcome to use Adobe SendNow to send your files (log in at https://sendnow.acrobat.com/SignIn.html). You can use the same Adobe ID and password that you use to log in to Send.
    Please let us know how it goes.
    Best,
    Sara

  • How to insert data from *.dmp file to  oracle 11g using Oracle SQL Develope

    hi
    i backup my database using PL/SQL developer and made *.dmp file
    how to insert data from *.dmp file to oracle 11g using Oracle SQL Developer 2.1.1.64
    and how to make *.dmp file from sql*plus ?
    thanks in advance

    Pl/Sql developer has a config window, there you choose the exec to do the import/export.
    Find it and his home version, it may be exp or expdp, the home version is the version of the client where the exp executable is.
    Then use the same version of imp or impdp to execute the import, you do not need to use Oracle SQL Developer 2.1.1.64. If you want to use it, you must have the same version in the oracle home that exp/imp of sql developer use.

  • Down-/Upload files via Web Services using a NON-SAP system!?

    Hello,
    is it possible to down-/upload files via web services using a NON-SAP system!?
    Regards,
    Jens

    Hi Jens,
    I am not sure about your requirement here. What i could understand is that you want to check whether service could handle file processing?
    1) Uploading file - You can build a Webservice which has import/export parameters as the file structures and implement the proxy class in such a way that the passed data is written to application server.
    2) Downloading file - Same as uploading file, but the proxy class would have the code to extract data from the application server and pass them as output parameter.
    Functionality of Non SAP system: The system which calls these services should be able to convert the output of proxy data into file in case of downloading the file and it should be able to convert the file data into export parameters in case of uploading file.
    Hope this helps.
    Regards,
    Prasanna

  • Uploading files to KM repository using Webdynpro APIs

    Hi All,
    I was reading the following blog /people/rohit.radhakrishnan/blog/2005/05/27/uploading-files-to-km-repository-using-webdynpro-apis and I was trying to upload a document from a URL for example http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif
    So far I am getting the following error:
    http:/ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif (No such file or directory (errno:2))
    Any Ideas?
    Regards,
    Orlando Covault

    Hi Jay,
    So far I think I followed all the intructions given in the links you provide. This is the snipped code
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
              try {
                   String path = "/documents";
                   IResourceContext resourceContext = buildResourceContext();
                   //       get a resource factory
                   IResourceFactory resourceFactory = ResourceFactory.getInstance();
                   //       Get a RID from the current path to display the according content
                   RID pathRID = RID.getRID(path);
                   //       Get a Iresource object to work on          
                   ICollection folder =
                        (ICollection) resourceFactory.getResource(
                             pathRID,
                             resourceContext);
                   String templateUrl =
                        WDURLGenerator.getResourcePath(
                             wdComponentAPI.getDeployableObjectPart(),
                             "PositionModPDFView_InteractiveForm.xdp");
                   File file = new File(templateUrl);
                   FileInputStream template = new FileInputStream(file);
                   manager.reportWarning(template.toString());
                   if (template != null) {
                        template.read();
                        Content content = new Content(template, "byte", -1L);
                        manager.reportWarning(content.getContentType());
                        IResource newResource =
                             folder.createResource("sap_logo1.gif", null, content);
                        template.close();
                   }else{
                        manager.reportException("Documento Vacio",false);
              } catch (ResourceException e) {
                   // TODO Auto-generated catch block
                   manager.reportException(e.getLocalizedMessage(), false);
              } catch (FileNotFoundException e) {
                   // TODO Auto-generated catch block
                   manager.reportException(e.getLocalizedMessage(), false);
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   manager.reportException(e.getLocalizedMessage(), false);
              } catch (ContentException e) {
                   // TODO Auto-generated catch block
                   manager.reportException(e.getLocalizedMessage(), false);
              } catch (WDAliasResolvingException e) {
                   // TODO Auto-generated catch block
                   manager.reportException(e.getLocalizedMessage(), false);
    But I am still getting the same error:  http://ntek.com.mx/wp-content/uploads/2008/12/sap_logo1.gif(No such file or directory (errno:2)) . Any Idea of what could be wriong?
    Regards,
    Orlando Covault

  • Excel data read from users and upload in to Oracle DB using custom webpart

    Hi Team,
    I need to get the excel date from user using file upload control and read the data from the excel using custom webpart and validate the each rows whether having the values or not and need to upload the data to the oracle database.
    Can you please let me know the best approach to read the data from excel using sharepoint custom webpart.
    Thanks,
    Mylsamy

    Hi,
    According to your post, my understanding is that you want to read excel data from the uploaded file and insert the data into Oracle Database.
    The following way for your reference:
    1.Create a Visual Web Part using Visual Studio.
    2. Add an asp.net upload control into the .ascx file.
    <div>
    <asp:FileUpload ID="fileupload" runat="server" />
    <asp:Button ID="btnUpload" runat="server" onclick="btnUpload_Click" Text="Upload" />
    </div>
    3. Add some logic methods into .ascx.cs file.
    protected void btnUpload_Click(object sender, EventArgs e)
    //read data and insert the data into Oracle database.
    4.We can create a web service for adding data to Oracle database, then consume this web service in the visual web part.
    More information:
    http://msdn.microsoft.com/en-us/library/ff597539(v=office.14).aspx
    http://manish4dotnet.blogspot.in/2013/02/upload-ans-read-excel-file-using-c.html
    http://msmvps.com/blogs/windsor/archive/2011/11/04/walkthrough-creating-a-custom-asp-net-asmx-web-service-in-sharepoint-2010.aspx
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Saving a PDF or DOC file into Oracle 9i using Developer Forms 10g

    Hi guys,
    I want to save a pdf or doc file into oracle 9i. I am using Developer 10 g. Please help me;
    1. What datatype field should be in database table to store such file.
    2. Which code should I use in Forms 10g to display open file dialog, get the name and save that into database table.
    Thanks in advance

    WEBUTIL is a library used with forms to interact with the client. With Forms10G the library comes shipped with the developer suite, for forms 9i i'm not sure, check the forms-page at otn if there is any download available. For documentation about how to do a file-upload, simply search the forum, there are lots of examples.

  • Check the size of uploaded file in Oracle UCM

    I need to check the size of the uploaded primary file in Oracle UCM during checkin. I tried writing a filter on the event validateStandard and check the value of dFileSize. But the value is null. Any ideas what event should I use and which parameter should I check?

    hi,
    I am new to Oracle UCM. I need same functionailty of checking file size of uploaded content. Could you please elaborate how you achieved it..... thanx in advance.

  • How to upload files from a form using pl/sql ?

    Hi
    Is it possible to upload the physical files outside the database (under UNIX server)using pl/sql? I already know how to store the files inside the database(wwwdoc_documents$) but I didn't find any documentation about storing the physical files outside the database.
    I have in my form the following component:
    <input type="file" name="upload">
    and I want to let the user browse for the file on his/her disc that he want to use. What I want to do next is to save a copy of that file on our file-server, and then use it in my application. How do I do that in pl/sql?
    Any help will be appreciated.
    Sebas.

    Thanks for the suggestion. I like this approach as Java is more familiar to me than other languages.
    Our DBA is out of touch today, so I could not grant the javauserpriv to my database user. I tried to run the script anyway in the chance that my user had the privs, and it seemed to have hung. I am now combing Oracle's site for more documentation so I can write some tests to see if I can get a basic Java object working. Under what heading would I find this?
    ajt

  • Cannot upload pictures on Ebay when using Firefox with Windows 8.1 - but works with IE 11

    Problem with uploading Photos on Ebay only when Firefox is my Browser - -
    Just recently I have noticed I cannot upload pictures anymore using the option STANDARD. I have to use their BASIC option, which is one picture at a time.
    When I select STANDARD I find that BROWSE does not respond. My configuration is Windows 8.1, 8gb memory and using the latest Firefox.
    Rather oddly it works fine with -
    8.1 + Internet Explorer
    XP + IE
    XP + Firefox
    Just this combination - no go.
    Any ideas ?

    Had same problem since I updated FF26. Always same old answers that don't work: reset FF, reinitialize, try "mode sans echec" (forgot english name for this), cut off addons, AV & firewall, check in config:about etc.. Think posts concerning this same problem are skattered all around because it has many different issues. And that's why FF has not yet digged to the genuine cause.
    My facts: 1) can't browse to send an attachment with an email (but I can with IE); 2) In tools/options if I check "ask where to record" browse doesn't work either. 3) In tools/options if I check "download in such or such file", then it does download in file named "telechargement" ( in french) but I can't choose another file because here again "browse" doesn't work.
    I saw a post somewhere talking about problems related to avast (it's my AV). Know if it's true?
    I'd be really glad if this could be solved cause I don't intend to change. FF is the best!

  • Cannot upload file through FTPS

    Hello,
    I am writing a FTPS Client (Explicit SSL) in java. For testing the same I am using the JScape FTP Server (Free Version). Altough have managed to login to the server, but cannot upload a file. Below is a brief description of the what's happeng in the code.
    1. Created a Socket
    controlSocket = new Socket(host, port);2. Issued AUTH TLS writer.write("AUTH TLS");3. Created controlSocket using SSLSocketFactory. Trusted all server SSL certificates.
    sslSocketFactory = sslContext.getSocketFactory();
    socket = sslSocketFactory.createSocket(socket, host, port, true);4. Issued the USER and PASS commands to login (Received success response)
    5. Issued TYPE A (Received success response)
    6. Issued PBSZ 0 and PROT P (Received success response)
    7. Issued PASV (Received success response)
    8. Retrieving the 'hostName' and the 'portNumber' from the reply for PASV
    9. Created dataSocket
    dataSocket = new Socket(hostName, portNumber);10. After the dataSocket creation, I am trying to retrieve the response from server when it is getting hanged.
    I don't have a clue why this is happening. Could someone help me with this.
    N.B. FileZilla Client however connects to the server and uploads data without any error.
    Edited by: saturn_cemk on Nov 13, 2009 1:22 AM

    I have also tried this... but it still hangs.
    dataSocket = sslSocketFactory.createSocket(remoteHost, remotePort);remoteHost and remotePort are the ones derived from the response for PASV.
    Do I need to do AUTH TLS again before creating the dataSocket ?? Am totally lost at this point.

  • Cannot upload file to TFTP on Subscriber

    All,
    I have an 8.5 cluster (pub and sub). I'm trying to upgrade the phone firmware for one phone by uploading a file to tftp.
    I can upload the zip file successfully to the pub, but when I try the same thing on the sub in OS Administration, I get 'Waiting for response from <sub IP>'
    in the status bar of the Upload File dialog box, and stays that way, never uploads.
    DB status is good, 2 on both boxes. TFTP service started on both servers.
    The other odd thing is that i can restart services for both servers from the pub, but when i try to restart services on the pub from the sub i get an error message that i cannot connect to the remote node (pub).
    Any thoughts?
    Thanks,

    I am not quite sure if what you are doing is a special requirement but generally for upgrading phone firmware, you need to download the COP file from CCO and use the Install/Upgrade drop down from CUCM, starting with Publisher and then the subscirber.
    Usually the error message states that their is a Tomcat certificate issues between the Pub/Sub. You should be able to go directly to the sub and restart the service. To fix the issue, is the Tomcat cert signed by a 3rd party CA, if yes then it will have to resigned. If its not, the Tomcat certificate will have to be regenerated and Tomcat service restart. This could also happen if you have a user with UserID administrator.
    Please rate useful posts.

  • Why cannot upload files to documents folder

    Hi all,
    I have EP7.0 and when i try to upload a file, it show me error:
         "N01_BB_InstallGuide_EN_US.doc" does not exist, or file is empty; you cannot upload empty files.
    Here N01_BB_InstallGuide_EN_US.doc is the file name, i tried several files, always get this error msg.
    Best regards,
    Peter

    Hi,
        I encountered the same problem, the Note helped.
    SAP Note : 898637
    Summary
    Symptom
    The upload of a file into a KM repository fails. Sometimes the user gets the error message "<file> does not exist, or file is empty; you cannot upload empty files."
    Reason and Prerequisites
    Either the portal engine or the operating system on which the portal runs has troubles with writing into the directory that is defined as store for temporary data.
    Solution
    1. With the config tool of the engine, edit/add the following two entries to the server node java parameters:
    Example:
    -Djava.io.tmpdir=e:\EP_TEMP
    -Dcm.tmpdir=e:\EP_TEMP
    These must point to an existing and accessible directory on the server.
    2. TEMP and TMP environment variables of operating system are to be set that they point to an existing and accessible directory.
    In case of Microsoft Windows, go to Settings > Control Panel > System, then choose the tab "Advanced" and the button "Environment Variables". There you can edit/create the two variables.
    Set them to the same directory that were selected for the engine parameters and especially make sure that none of the temp variables has a value with percentage characters ("%") or other placeholders but a particular directory.
    Example: e:\EP_TEMP
    Afterwards, give the user SAPService<SID> write-access rights to the selected temporary folder and restart the Windows machine

Maybe you are looking for

  • MIRO reversal issue

    Hi, We have booked a Service tax related bill through MIRO. Same document is reversed. But the reversal document does not show the same Service tax related GLs as in original document. Meaning, the reversal effect (only for service tax lines/amounts)

  • Can't export timeline as a Windows Media file anymore.

    Using Premiere 5.0.3 for over 2 yrs now.  No problems until now.  I first export my 30 min. timeline as a H.264 file as a master.  No problem.  Then I would export my timeline as a Windows Media file (NTSC Widescreen) for easier viewing on other comp

  • QRFC Monitor (Outbound Queue) Destination

    Hi Experts, In t-code SMQ1, there is no destination defined for the queue name "MCEX03". Although there are LUW entries in the same table column, but no records in rsa7. How can we input the destination name? Please advise. Regards.

  • Displaying results of a query

    Hi there I want to display the results of a query. OK I do kow how to do that. I do have one long text field (MySQL) and in some cases the colomn I iwsh to display has a page of information. I just want to display say the first 300 characters. I was

  • Insert excel file into a table

    Hi all, I have a excel file with a lot of records. I want to insert all this records into a table without using a insert statement for every record. Can any one help me with this? ekas