Inserting Clobs In Java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • msankardas
    New Member
    • Nov 2007
    • 7

    #1

    Inserting Clobs In Java

    Hi,

    I am a new member. My name is MANU. I am currently working on a java application that requires me to insert a zip file as a clob in a database. If anyone could help me on this as soon as possible, would really appreciate it.

    I would really appreciate the sample code...

    I am working on TERADATA DATABASE.. so if anyone is using that and knows the solution would be really helpful.. Else, the solution in Oracle or DB2 will be highly appreciated.

    Thanks in advance
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    For a zip file, better use a blob instead (Binary large object instead of Character
    large object). You create a blob, open a Writer on it and write to it. For reading,
    retrieve it, open a Reader and read its contents.

    kind regards,

    Jos

    Comment

    • msankardas
      New Member
      • Nov 2007
      • 7

      #3
      Originally posted by JosAH
      For a zip file, better use a blob instead (Binary large object instead of Character
      large object). You create a blob, open a Writer on it and write to it. For reading,
      retrieve it, open a Reader and read its contents.

      kind regards,

      Jos

      thanks. I will try it and let u know how it goes..
      how do u decide which is better, a blob or a clob, for a zip file? also can u provide me some sample code just to ensure how its done??
      thanks in advance ..

      Manu

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by msankardas
        thanks. I will try it and let u know how it goes..
        how do u decide which is better, a blob or a clob, for a zip file? also can u provide me some sample code just to ensure how its done??
        thanks in advance ..

        Manu
        A lob is a binary large object. A clob is a character large object.
        If you want to store a large binary object use a blob is you want to store a large object with characters only use a clob.

        Comment

        • msankardas
          New Member
          • Nov 2007
          • 7

          #5
          Originally posted by r035198x
          A lob is a binary large object. A clob is a character large object.
          If you want to store a large binary object use a blob is you want to store a large object with characters only use a clob.
          can anyone help me with the code... i havent used clobs before.. .so have no clue...

          regards
          Manu

          Comment

          • r035198x
            MVP
            • Sep 2006
            • 13225

            #6
            Originally posted by msankardas
            can anyone help me with the code... i havent used clobs before.. .so have no clue...

            regards
            Manu
            It's best that you get a tutorial on the subject and read it.

            Comment

            Working...