Could you please tell me the code how to Insert the  file into clob database field

Posted on 2011-05-05
Last Modified: 2012-06-22
Could you please tell me the code how to Insert the  file into clob database field

please give me the code that should be urgent
Question by:stmani2005
    LVL 23

    Expert Comment

    LVL 86

    Accepted Solution

    You can simplify that somewhat with the >= 1.6
    FileReader reader = new FileReader("foo.txt");
    stmt.setCharacterStream(3, reader);

    Open in new window

    LVL 3

    Expert Comment


    PreparedStatement stmt = conn.prepareStatement(sql);
        stmt.setString(1, "abc");

        File data = new File("temp.txt");
        FileReader reader = new FileReader(data);
        stmt.setCharacterStream(2, reader, (int) data.length());
    LVL 86

    Expert Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Suggested Solutions

    Title # Comments Views Activity
    Need some clarity on Rest API 5 51
    what is spring 3 35
    linearIn  challenge 23 54
    Return ZipOutputStream using Servlet 2 26
    By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
    Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now