Package oracle.sql

Examples of oracle.sql.BLOB


            stmt = connection.createStatement();
            rs = stmt.executeQuery(theQuery);
            if (rs.next()) {

                BLOB blob = (oracle.sql.BLOB) rs.getBlob(1);

                out = blob.getBinaryOutputStream();
                chunkSize = blob.getChunkSize();
                logger.debug9(".. current chunk size: " + chunkSize);
                byte[] buffer = new byte[chunkSize];

                int bytesRead = 0;
                while ((bytesRead = in.read(buffer)) != -1) {
View Full Code Here


            theQuery = normalizeStatement(query.toString(), replacement);
            logger.debug9(".. select the BLOB: " + theQuery);

            rs = stmt.executeQuery(theQuery);
            if (rs.next()) {
                BLOB blob = (oracle.sql.BLOB) rs.getBlob(1);
                out = blob.getBinaryOutputStream();
                chunkSize = blob.getChunkSize();
                logger.debug9(".. current chunk size: " + chunkSize);
                byte[] buffer = new byte[chunkSize];
                int bytesRead = 0;
                while ((bytesRead = in.read(buffer)) != -1) {
                    out.write(buffer, 0, bytesRead);
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

    PyObject obj = Py.None;

    switch (type) {

      case Types.BLOB :
        BLOB blob = ((OracleResultSet)set).getBLOB(col);

        if (blob == null) {
          return Py.None;
        }

        InputStream stream = new BufferedInputStream(blob.getBinaryStream());

        obj = Py.java2py(DataHandler.read(stream));
        break;

      case OracleTypes.ROWID :
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

                                }

                                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

       
                rs = pstmt.executeQuery();
       
                if( rs.next() ) {
       
                  BLOB myBlob = (BLOB)rs.getBlob(1);
                  myBlob.putBytes(1, b);
       
                } else {
                  // not in database, do insert:
                  PreparedStatement pstmt2 = _preparedStatements[pool][WRITE_STATE_NEW];
       
                  if (pstmt2 == null)
                  {
                    pstmt2 = _theConnection[pool].prepareStatement("INSERT INTO "+tableName+" (StateType,TypeName,UidString,ObjectState) VALUES (?,?,?,empty_blob())");
       
                    _preparedStatements[pool][WRITE_STATE_NEW] = pstmt2;
                  }
       
                  pstmt2.setInt(1, s);
                  pstmt2.setString(2, tName);
                  pstmt2.setString(3, objUid.stringForm());
       
                  pstmt2.executeUpdate();
                  _theConnection[pool].commit();
       
                  PreparedStatement pstmt3 = _preparedStatements[pool][SELECT_FOR_WRITE_STATE];
                  if(pstmt3 == null) {
                    pstmt3 = _theConnection[pool].prepareStatement("SELECT ObjectState FROM "+tableName+" WHERE UidString = ? AND TypeName = ? AND StateType = ? FOR UPDATE");
                    _preparedStatements[pool][SELECT_FOR_WRITE_STATE] = pstmt3;
                  }
       
                  pstmt3.setString(1, objUid.stringForm());
                  pstmt3.setString(2, tName);
                  pstmt3.setInt(3, s);
       
                  rs3 = pstmt3.executeQuery();
                  rs3.next();
                  BLOB myBlob = (BLOB)rs3.getBlob(1);
                  myBlob.putBytes(1, b);
                }
       
                _theConnection[pool].commit();
                        return true ;
       
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

                                }

                                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

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.