[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 212
  • Last Modified:

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

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
0
Manikandan Thiagarajan
Asked:
Manikandan Thiagarajan
  • 2
1 Solution
 
CEHJCommented:
You can simplify that somewhat with the >= 1.6
FileReader reader = new FileReader("foo.txt");
stmt.setCharacterStream(3, reader);

Open in new window

0
 
amitkathpal123Commented:
http://stackoverflow.com/questions/5549450/java-how-to-insert-clob-into-oracle-database

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());
    stmt.execute();
0
 
CEHJCommented:
:)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now