Package oracle.sql

Examples of oracle.sql.BLOB


                                }

                                output = new BufferedOutputStream(ascii.getAsciiOutputStream());
                                bufSize = ascii.getBufferSize();
                            } else {
                                BLOB binary = set.getBLOB(index);
                                File binaryFile = (File) attr;
                                stream = new BufferedInputStream(new FileInputStream(binaryFile));
                                length = (int) binaryFile.length();

                                output = new BufferedOutputStream(binary.getBinaryOutputStream());
                                bufSize = binary.getBufferSize();
                            }

                            byte[] buffer = new byte[bufSize];
                            while ((length = stream.read(buffer)) != -1) {
                                output.write(buffer, 0, length);
View Full Code Here


                                }

                                output = new BufferedOutputStream(ascii.getAsciiOutputStream());
                                bufSize = ascii.getBufferSize();
                            } else {
                                BLOB binary = set.getBLOB(index);
                                File binaryFile = (File) attr;
                                stream = new BufferedInputStream(new FileInputStream(binaryFile));
                                length = (int) binaryFile.length();

                                output = new BufferedOutputStream(binary.getBinaryOutputStream());
                                bufSize = binary.getBufferSize();
                            }

                            byte[] buffer = new byte[bufSize];
                            while ((length = stream.read(buffer)) != -1) {
                                output.write(buffer, 0, length);
View Full Code Here

                            : Py.newDecimal(number);
                }
                break;

            case Types.BLOB:
                BLOB blob = ((OracleResultSet) set).getBLOB(col);
                obj = blob == null ? Py.None : Py.java2py(read(blob.getBinaryStream()));
                break;

            case OracleTypes.TIMESTAMPLTZ:
            case OracleTypes.TIMESTAMPTZ:
                // XXX: We should include time zone information, but cx_Oracle currently
View Full Code Here

                                }

                                output = new BufferedOutputStream(ascii.getAsciiOutputStream());
                                bufSize = ascii.getBufferSize();
                            } else {
                                BLOB binary = set.getBLOB(index);
                                File binaryFile = (File) attr;
                                stream = new BufferedInputStream(new FileInputStream(binaryFile));
                                length = (int) binaryFile.length();

                                output = new BufferedOutputStream(binary.getBinaryOutputStream());
                                bufSize = binary.getBufferSize();
                            }

                            byte[] buffer = new byte[bufSize];
                            while ((length = stream.read(buffer)) != -1) {
                                output.write(buffer, 0, length);
View Full Code Here

                writer.write(str);
                writer.flush();
                writer.close();
            } else if(isBlobType(type)) {
                InputStream is = (InputStream)obj;
                BLOB blob = BLOB.createTemporary(conn, true, BLOB.DURATION_CALL);
                pstmt.setBlob(i + mediateLoc, blob);
                OutputStream os = new BufferedOutputStream(blob.getBinaryOutputStream());
                IOUtils.copy(is, os);
                os.flush();
                os.close();

            } else {
View Full Code Here

            writer.flush();
            writer.close();
        }
        for ( int i = 0; i < params.length; i++ ) {
            if (! isBlobType(types[i])) continue ;
            BLOB blob = ostmt.getBLOB( i + 2 );
            InputStream is = (InputStream)params[i] ;
            OutputStream os = blob.getBinaryOutputStream() ;
            IOUtils.copy(is, os) ;
            os.flush();
            os.close();
        }
    }
View Full Code Here

/*     */
/* 192 */             rs = pstmt.executeQuery();
/*     */
/* 194 */             if (rs.next())
/*     */             {
/* 196 */               BLOB myBlob = (BLOB)rs.getBlob(1);
/* 197 */               myBlob.putBytes(1L, b);
/*     */             }
/*     */             else
/*     */             {
/* 201 */               pstmt2 = this._preparedStatements[pool][6];
/*     */
/* 203 */               if (pstmt2 == null)
/*     */               {
/* 205 */                 pstmt2 = this._theConnection[pool].prepareStatement("INSERT INTO " + tableName + " (StateType,TypeName,UidString,ObjectState) VALUES (?,?,?,empty_blob())");
/*     */
/* 207 */                 this._preparedStatements[pool][6] = pstmt2;
/*     */               }
/*     */
/* 210 */               pstmt2.setInt(1, s);
/* 211 */               pstmt2.setString(2, tName);
/* 212 */               pstmt2.setString(3, objUid.stringForm());
/*     */
/* 214 */               pstmt2.executeUpdate();
/* 215 */               this._theConnection[pool].commit();
/*     */
/* 217 */               PreparedStatement pstmt3 = this._preparedStatements[pool][8];
/* 218 */               if (pstmt3 == null) {
/* 219 */                 pstmt3 = this._theConnection[pool].prepareStatement("SELECT ObjectState FROM " + tableName + " WHERE UidString = ? AND TypeName = ? AND StateType = ? FOR UPDATE");
/* 220 */                 this._preparedStatements[pool][8] = pstmt3;
/*     */               }
/*     */
/* 223 */               pstmt3.setString(1, objUid.stringForm());
/* 224 */               pstmt3.setString(2, tName);
/* 225 */               pstmt3.setInt(3, s);
/*     */
/* 227 */               rs3 = pstmt3.executeQuery();
/* 228 */               rs3.next();
/* 229 */               BLOB myBlob = (BLOB)rs3.getBlob(1);
/* 230 */               myBlob.putBytes(1L, b);
/*     */             }
/*     */
/* 233 */             this._theConnection[pool].commit();
/* 234 */             pstmt2 = 1;
/*     */             try
View Full Code Here

          if(value.indexOf("assetBlob:") > -1)
          {
            String fileName = value.substring(10);
            FileInputStream fis = new FileInputStream(fileName);
           
            BLOB bl = BLOB.createTemporary(conn, true, BLOB.DURATION_CALL);
            bl.open(BLOB.MODE_READWRITE);

            BufferedOutputStream out = new BufferedOutputStream(bl.getBinaryOutputStream());
   
            byte[] buffer = new byte[1024];
            int len;

            while((len = fis.read(buffer)) >= 0)
View Full Code Here

TOP

Related Classes of oracle.sql.BLOB

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.