DBAsupport.com Forums - Powered by vBulletin
Results 1 to 3 of 3

Thread: Retrieveing The Clob Fields In Oracle 10g

  1. #1
    Join Date
    Apr 2006
    Posts
    1

    Retrieveing The Clob Fields In Oracle 10g

    Hai i want to know how to retrieve the clob fields from a table(i am using oracle 10g). I am able to insert a video file in to the clob field of the table, but unable to retrive, it is telling general error.

    when i am trying to retrieve the clob field it is telling that there is a general error. CAN ANY ONE TRY TO TELL HOW TO RETRIVE


    i am putting the code hear




    The insertion code is


    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.File" %>
    <%@ page import="java.util.Date" %>
    <%@ page import="java.util.Properties" %>
    <%@ page import="java.io.*" %>


    <%
    Properties props = new Properties();
    props.put("user", "intelligent");
    props.put("password", "intercom");
    props.put("SetBigStringTryClob", "true");

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbcdbc:intelligent",props);
    try
    {
    PreparedStatement ps = con.prepareStatement("INSERT INTO persons1 values(?,?)");
    String fn="D:\\test\\er.wma";
    BufferedReader br = new BufferedReader(new FileReader(fn));
    String nextLine = "";
    StringBuffer sb = new StringBuffer();
    while ((nextLine = br.readLine()) != null)
    { sb.append(nextLine); }
    // Convert the content into to a string
    String clobData = sb.toString(); // Return the data.


    ps.setString(1,"krishna");
    ps.setString(2,clobData);
    ps.executeUpdate();

    ps.close();
    con.close();
    }

    catch(Exception e)
    {
    out.println(e.getMessage());
    }



    %>







    The retrieving code is







    <%@ page import="java.sql.*" %>
    <%@ page import="java.io.File" %>
    <%@ page import="java.util.Date" %>
    <%@ page import="java.util.Properties" %>
    <%@ page import="java.io.*" %>


    <%
    out.println("gdjhg");

    Properties props1 = new Properties();
    props1.put("user", "intelligent");
    props1.put("password", "intercom");
    props1.put("SetBigStringTryClob", "true");

    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con=DriverManager.getConnection("jdbcdbc:intelligent",props1);
    out.println("gdjhg");

    try
    {
    String sqlcall="select name,pictur from persons1";
    PreparedStatement ps1 = con.prepareStatement(sqlcall);
    out.println("thanks");
    ResultSet rs1 = ps1.executeQuery();
    out.println("gdjhg");
    String n1=null;
    String clobVal = null;

    while (rs1.next()) {
    String n1 = rs1.getString(1);
    String c1= rs1.getString(2);
    }

    }

    catch(Exception e)
    {
    out.println(e.getMessage());
    }





    %>





  2. #2
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    you cant put a video in a clob and you post no code and no error and generaly no details whatsoever

    so whats going on here hmmmm

  3. #3
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    Is not it good idea to use BLOB instead of CLOB?

    Tamil
    www.beaconinfotechcorp.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width