title: Unable to convert the CLOB data into String
body: <p>I am trying to convert <strong><code>java.sql.Clob</code></strong> data into <code>String</code> by using <strong><code>SubString</code></strong> method (This method giving good performance compared with other). The clob data having near or morethan to <strong><code>32MB</code></strong>. AS my observation substring method able to to return upto <strong><code>33554342</code></strong> bytes only.</p>
  
  <p>if clob data is crossing 33554342 bytes then this it's throwing below sql exception<br>
  <strong><code>ORA-24817: Unable to allocate the given chunk for current lob operation</code></strong></p>
  
  <p>EDIT 
  CODE:</p>
  
  <pre><code>public static void main(String[] args) throws SQLException {
  
      Main main = new Main();
      Connection con = main.getConnection();
      if (con == null)    {
          return;
      }
  
      PreparedStatement   pstmt   =   null;
      ResultSet   rs  =   null;
      String sql  =   "SELECT Table_ID,CLOB_FILE FROM TableName WHERE SOMECONDITION ";
  
      String table_Id = null;
      String directClobInStr  =   null;
      CLOB clobObj = null;
      String clobStr = null;
      Object obj= null;
      try {
          pstmt   =   con.prepareStatement(sql);
          rs      =   pstmt.executeQuery();
          while (rs.next())   {
              table_Id    =  rs.getString( "Table_ID" ) ; 
              directClobInStr =  rs.getString( "clob_FILE" ) ;
                        obj       =  rs.getObject( "CLOB_FILE");
  
              clobObj = (CLOB) obj;
               System.out.println("Table id " + table_Id);
               System.out.println("directClobInStr "   + directClobInStr);
               clobStr = clobObj.getSubString(1L, (int)clobObj.length() );//33554342
               System.out.println("clobDataStr = " + clobStr);
          }
      }
      catch (SQLException e) {
          e.printStackTrace();
          return;
      }
      catch (Exception e) {
          e.printStackTrace();
          return;
      }
      finally {
          try {
          rs.close();
          pstmt.close();
          con.close();
          }
          catch (Exception e) {
              System.out.println(e.getMessage());
          }
      }
  }
  </code></pre>
  
  <p>NOTE:- here <code>obj =  rs.getObject( "CLOB_FILE");</code> working but I am not expecting this. because I am getting <code>ResultSet</code> object from somewhere as Object. I have to convert and get the data from CLOB </p>
  
  <p>Any Idea how to achieve this?</p>