To store images in the database

hello,
from these rows of code I get one image that come from a web camera:
   FrameGrabbingControl frameGrabbingControl = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
   Buffer buffer = frameGrabbingControl.grabFrame();
   BufferToImage bufferToImage = new BufferToImage((VideoFormat) buffer.getFormat());
   Image image = bufferToImage.createImage(buffer);I need store this image on Blob column of a database and, to do it, it needs of a FileInputStream type.
(pStatement.setBinaryStream(4, bynaryStream);)I saw that the elaboration to convert Image to FileInputStream is not easy and is complex too,
I tried it with unsuccess, and I am having problem to do it.
Some one could say me if the JMF API allow to get what I need in more direct way than have image and
after to convert it in FileInputStream ?
Otherwise I should happy to have some advice about how to do that converion ..
some one could help me ?
thank you
regards
tonyMrsangelo

I recently did some work serializing an object for transport via UDP packets using a class called:
ByteArrayInputStream
/* Grab the frame as a buffer */
FrameGrabbingControl frameGrabbingControl = (FrameGrabbingControl) player.getControl("javax.media.control.FrameGrabbingControl");
Buffer buffer = frameGrabbingControl.grabFrame();
/* Convert the buffer's data into a byte array */
byte[] data = (byte[])buffer.getData();
/* Wrap our byte array in an input stream */
ByteArrayInputStream bais = new ByteArrayInputStream(data);
/* Set the binary stream of our pStatement */
pStatement.setBinaryStream(4, bais);

Similar Messages

  • How to store image in the oracle database 10.2. using File Maker 10.

    Hi.,
    I want to store image, media file in the oracle database using File Maker as a front end.
    I connect Oracle using odbc from file maker. There are table and in that table there a column "pict" of blob type. but this column is not showing in the file maker.
    2. Here I can not change the data type of any column.
    Now how to store images in the oracle table using odbc or any other tool.
    Regards,
    Shyam

    I wrote an example for my students, you can find it here. It's using PHP as the front end but all you need to do is know how and leverage the stored procedures. All code is downloadable in zip files from the blog.
    http://blog.mclaughlinsoftware.com/php-programming/oracle-lob-processing/

  • Is it better to store the image in the database or to use BFile

    Hi all,
    I've a doubt regarding the handling of the image. For example i've the images of the persons amounting to 50,000(the number will be increased in future). So i just want to know which is the better menthod. is it better to store all the images in the database or to store in local OS and use Bfile concept. I'm using Forms 6i and Forms 10g(10.1.2.0.2). OS: Windows XP
    Regards,
    Alok Dubey
    Edited by: Alok Dubey on Nov 14, 2008 5:43 PM

    But the total number (i.e.., 50,000) is scaring me to use the BlobI don't think the database will cause problem just due to the amount of data stored in blobs. Of coure you would have to check which parameters to set for the blobs to make storage efficient. If
    You didn't mention your db-version, in 11G you could also think of using compression and deduplication to deal with the data amount.
    In general i agree with Francois, the best way depends, but in terms of data consistency and easy backup/restore there might be some advantages in using the blob-version.
    hope this helps.

  • How do i store and fetch image from the Database(Access)

    i am facing one problem in inserting the image into the database.the steps i followed as
    1)i have created one database(access) as "Image" and into that one table as "Image" and field as "image"
    type of the field is ole object.
    2)i have inserted one image into the image field through "database.vi"
    3)now i am trying to get the image from the database by "Fetching Example.vi"
    4)it will succesfully retrieve the image from that field .
    5)but when i close the both programs and reopen those that time i am unable to get retrieve the image.
    Attachments:
    Add_to_Database.vi ‏78 KB
    Fetch_from_database.vi ‏67 KB

    I would like to suggest different approach for saving the images in the database.
    I was working on Medical Imaging Company. The way we save the images in real-time was by writing the name and path of the images to database.
    The images themselves where saved directly to disk.
    I don�t think that access is very good in taking care of GBytes of data.
    It happens some time that the database gets damage. If you have the images separately you can create fix procedure. (We had one).
    Good Lack,
    Amit Shachaf,

  • Uploading of image to the database?

    Hi all, how do we bring up a File browser window on oracle form and upload a pic to the database?
    Can someone show me how they will create a simple db to store image, and the file browser window method?

    Here are a couple of links to information on storing files in an Oracle database. Hope they help.
    How to: Read and Write BLOB data to a Database Table...
    Storing pictures and photos in Oracle tables
    Craig...

  • Reading the contents of a folder and store them in the database using 6i

    Hi all,
    I'm using developer 6i and oracle 8i,now am building personnel database,every employee has many certificates (graduate certificates,post-graduate certificates and work experience certificates),I want to scan all these certificates,put them in a folder ,give the form (employee form ) the path to the folder and the form read the contents of the folder (3 or 4 image files for example) dynamically and store them in the database.
    All examples I came across explain how to load a defined image file name into oracle database,but what if the image file name is not defined (i,e dynamically generated by the scanner).
    Hope I explained the case.
    Thanks in advance

    Sorry mhdamer,
    I read the example and thought it could be modified to retreive a directory listing. There is a way to do what you want, but you will have to check to see if you have the D2kwutil.pll installed with Forms 6i. If you do not have it installed you can download the pll from OTN. This Forms Library will only work on Windows, so if you want this functionality on a non-windows machine, it will not work. Read the D2KWUTIL.html for details on how to use this library. There are also some good posts here in the forums on how to use this library. Just search on D2KWUTIL.PLL.
    Craig...

  • Storing images inside the database

    hi,
    we are running oracle 9ir2 on Solaris and would like to know how to go about achiving the following:
    would like to be able to read/write/create/delete bitmap image files in a file share on the same server as the database which would be stored in a table within our schema in the form <filename varchar2>,<image-file-contents blob>
    Is this possible?! If so - any pointers in the right direction would be great!
    thanks,
    p

    To some extent, this was covered a few days ago in the PL/SQL forum. There are some examples of uploading image files to blobs in the database here.
    upload any file (like .DOC,.JDG) to oracle database?
    If you want the images to be visible on a file system, you may want to use BFILE's, rather than BLOB's. BFILE's are essentially pointers in the database to file system objects, while BLOB's are stored completely in the database. The major disadvantages of BFILE's are that
    - the file may be deleted or moved, leaving the Oracle BFILE pointing at nothing
    - the file won't be backed up with the rest of the database
    Going up a level of sophistication, you could store the images using interMedia. This gives you significantly more options for manipulating the images within the database.
    Finally, you can use Oracle iFS (or whatever it's been renamed to today) to provide a file system interface to an Oracle database. This is the most robust of the options, but is also the most work to configure.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Which is better? store files in the database or directly on the O.S.?

    Hi,
    i´m developing an application to manager files. which is better? store files in the database or directly on the O.S.? If i decide to store on database, i will use the BLOB data type but i have a doubt...the BLOB data type occupies the same space on database regardless of file size? there is another data type better?
    Tks,
    Fernando.

    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1011065100346196442
    Ask Tom has a bit of info to share on the topic. Have a read of this. :)

  • Can BI Publisher read the images from the Database?

    Hi All,
    Can BI Publisher read the images from the Database?
    if yes how it can be achieved?
    Thanks
    Aravind

    Hi,
    There is an example in oracle db. Use the schema PM (Print Media).
    Select the corresponding table that contains the column AD_PHOTO.
    In your RTF template simply to print the image stored in the db use:
    <fo:instream-foreign-object content-type="image/jpg"> <xsl:value-of select="AD_PHOTO"/>
    </fo:instream-foreign-object>
    RUn the RTF template and it should show you all.
    Cheers
    Jorge
    p.s. If this answers your question then please grant the points and close the thread

  • Loading an Image from the database and display it on browser

    I do not know if this is even possible.
    At the moment, to load an image inside an Html page you need to use the <img src=""> tag. and in the src you put the path of the image. Now I would like to save an image inside the database.
    An option to still display the image on the browser would be that my service object, would load the object from the database (saved as blob) then save it somewhere on the Server, and the still use the <img> tag to load the image from that location.
    However I was wondering wheather there is another way to do it without saving this image on the server. that is loading the bytes from the database (or a location on the server) and provided these bytes to the jsp page to display the image.
    Is this possible? or?
    regards,
    sim085

    hmm ... ok .. that sounds good .. but that means that
    a servlet must exsist at all time to display the
    required image.Servlets are usually instantiated by the servlet container upon an incoming request.

  • How to store image in the oracle database 10.2.

    Hi.,
    I am working on 10g ids. I have designed a form where there are two fields. Name and picture.
    I want to keep details of the person with their photo.
    I can simply put name but how to insert image in the picture field??
    can you suggest ??
    Thanks.
    Shyam

    Hi
    To store your binary images in an Oracle database, you will need to create a column in your table defined with the BLOB datatype BLOB stands for Binary Large Object. Images from scanners, mpeg files, movie files and so on can all be stored in the BLOB column
    sq>CREATE TABLE test_table (
       id NUMBER,
       image BLOB);then go to
    [http://download-west.oracle.com/docs/cd/B14117_01/appdev.101/b10796/toc.htm]

  • How to store images in the File Object????

    Clearly saying i wrote a jsp program which contains an input tag as follows
    <form action="filename.jsp">
    <input type="file" name="path">
    <input type="submit" value="submit">In the above input tag i entered a file path looks like c:\Sunset.jpg .But after i hit submit button it is not taking the absolute path instead it is taking relative path Sunset.jpg ...
    Can any one figure out the problem...
    My jsp code
    filename.jsp
    <%
              Class.forName(drivername);
              Connection con=DriverManager.getConnection("URL",usr,pwd);
              File file=new File(request.getParameter("path");                // example path="c:\Sunset.jpg
    %>{code}
    In the above program +request.getParameter("path")+ returns null I don't know why this is happening
    i wasted nearly three days please any one help me out............                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I asked a similar question once and the answer I got was - Don't.
    Instead, store the images on a drive somewhere and store the path in the database.
    But I'm no expert - that's just what I was told by someone who does this kind of stuff a lot.
    Hope that helps.

  • Puttin Images Into the Database

    I am designing an artists painting archive.
    I have been able to introduce non-database images into a part of the template, utilizing HTML . GREAT!! ---- BUT, I'm not really understanding how to database the images themselves. I think I have the relevant code/instructions below.
    Could anybody help me "see" these instructions (below) a little better? I think I'm missing something. My confusion starts with the table -- what exactly should it look like?
    Thanks,
    Osunga

    First (make sure that you are logged in as the ADMIN for the ApEx Schema)
    Create the table and indexes
    create table TS_IMAGES (
    IMAGE_ID number not null,
    NAME varchar2(200) not null,
    FILENAME varchar2(200),
    MIME_TYPE varchar2(255),
    DOC_SIZE number,
    CREATED_BY varchar2(255),
    CREATED_ON date,
    CONTENT_TYPE varchar2(128),
    BLOB_CONTENT blob null
    create unique index UK_TS_IMAGE_ID on TS_IMAGES( IMAGE_ID )
    create unique index UK_TS_IMAGE_NAME on TS_IMAGES( NAME )
    --Now create the display procedure
    CREATE OR REPLACE PROCEDURE ts_image_display (p_id IN NUMBER)
    AS
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (200);
    l_blob BLOB;
    BEGIN
    SELECT MIME_TYPE, BLOB_CONTENT, NAME, DBMS_LOB.getlength (BLOB_CONTENT)
    INTO l_mime, l_blob, l_file_name, l_length
    FROM TS_IMAGES
    WHERE IMAGE_ID = p_id;
    OWA_UTIL.mime_header (NVL (l_mime, 'application/octet'), FALSE);
    HTP.p ('Content-length: ' || l_length);
    OWA_UTIL.http_header_close;
    WPG_DOCLOAD.download_file (l_blob);
    END ts_image_display;
    --DON'T forget this!!!!
    GRANT EXECUTE ON ts_image_display to PUBLIC;
    Next create your page and region with a FILE BROWSE item and UPLOAD button. Have the UPLOAD button trigger this PL/SQL procedure
    (I threw in a few of my own fields as well)
    declare
    i NUMBER;
    begin
    --copy the image from wwv_flow_files to ts_cab_card_img
    insert into TS_IMAGES (
    IMAGE_ID, NAME, FILENAME, MIME_TYPE, DOC_SIZE, CREATED_BY,
    CREATED_ON, CONTENT_TYPE, BLOB_CONTENT)
    select ID, NAME, FILENAME, MIME_TYPE, DOC_SIZE, CREATED_BY,
    CREATED_ON, CONTENT_TYPE, BLOB_CONTENT
    from wwv_flow_files
    where NAME = :P10_NAME;
    --get the ID for the corrollary table
    select IMAGE_ID into i
    from TS_IMAGES
    where NAME = :P10_NAME;
    --add corrollary data to secondary table
    insert into TS_CAB_CARD_DATA (IMAGE_ID, VIN, LICENSE, LICENSE_ST, LICENSE_EXPIRE,
    VEH_YEAR, VEH_MAKE, VEH_MODEL, TS_ID, GVW, OVERLENGTH_PERMIT)
    values (i, :P10_VIN, :P10_LICENSE, :P10_STATE, to_date(:P10_LICENSE_EXP, 'MM/DD/YYYY'),
    :P10_V_YR, :P10_V_MAKE, :P10_V_MODEL, :P10_TS_V_ID, :P10_GVW, :P10_PERMIT);
    --delete the original
    delete from wwv_flow_files
    where NAME = :P10_NAME;
    end;
    Mine takes additional fields and adds the data to a corrollary table linked by ID. This allows me to customize the type of extra data I store independent of the image. Also note that the variable names will change according to your application.
    Now create another page with a report region. Here's a query to display the report:
    select IMAGE_ID from TS_IMAGES
    Now edit the field in the REPORT and put the following code in as the HTML Expression
    [img src="#OWNER#.ts_image_display?p_id=#IMAGE_ID#" /]
    (replace the brackets with the standard lt/gt
    Voila! It works!

  • How to store image in oracle database and retrieve

    Hi i want to store a image in oracle database, user will select the image and i want tht image to store in database in java/jsp can anybody help

    try the following in yr app
    try{
    File fileObject = new File("img path");
    FileInputStream fisObject = new FileInputStream(fileObject);
    PreparedStatement pstmt =
    conn.prepareStatement("insert into IMG_TABLE values (?,?)");
    pstmt.setString(1,fileObject.getName());
    pstmt.setBinaryStream(2,fisObject,(int)fileObject.length());
    pstmt.executeUpdate();
    catch(SQLException se)
    se.printStackTrace();
    catch(Exception ee)
    ee.printStackTrace();
    }

  • Display Image from the database but prevent it from refreshing on every pages

    Hi there,
    I can see there are many discussions around this but my query is slightly different. I'm writing this on behalf of one of my developers. (sorry for my ignorance on techie stuff.. :-))
    A logo is being displayed on a few pages, which is called from the database. However, the problem is that  - this logo refreshes every time when you traverse to each page causing a performance issue or sometimes slow loading of the image.
    My question is - how do we stop it from loading on each page from the database?.  I would rather load once when the main page loads initially and then maintain this on other pages too.
    We can keep this logo on a file system (FS)  and display it via CSS/HTML/frame but since we want to keep it flexible/dynamic where a user can upload a new one whenever it changes and hence DB seems to be the suitable option (in my opinion).
    Can someone please help?
    If you need any further info around the coding how it is being done at present, pls let me know.
    Thank you

    read this http://docs.oracle.com/cd/B28359_01/appdev.111/b28393/adlob_tables.htm#g1017777
    you can cache lobs in the database too
    you can also upload the pic in your file system using utl_file package and then put the image in the working directory mentioned in i.war
    you can then reference the image and it will not be stored in the database and will be cached
    Regards,
    Vishal
    Oracle APEX 4.2 Reporting | Packt Publishing
    Vishal's blog

Maybe you are looking for

  • How do I add a second computer to my time capsule?

    My husband has finally been converted to a Mac but I am having trouble getting his new toy added to my wireless network, which is locked.  How do I unlock long enough to allow his computer to "join the club", then lock it again to keep the network se

  • External monitor compatibility

    Does anyone know if the black macbook is compatible with a Full HD 1080p LCD monitor? If so, what adapter do I need to make it work with the macbook

  • Shared Review Acrobat X Shows copy of 1st review file opened

    I have organized many shared reviews using Acrobat Pro from v. 8 until  X. Ever since my Windows upgrade I have encountered some problems. The most egregious of these is the following: If I open up a Shared Review pdf I can only see it as I saw it th

  • Regarding Value and Binding properties of af:inputTextBox

    Hi All, I am using JDeveloper 11.1.1.6.0. I want to set the value for af:inputTextBox from the backing bean. I observed there are two properties for this component, 'Value' and 'binding'. So, I thought of using 'Value' property. For this I created a

  • SQL ... varray / object types

    use 8i I have a problem with VARRAYS. With the following script there is an error when creating the VArray -> TypVa_STUDENT . "Type created with compilation errors" (Oracle SQLPlus) I can't explain why. Could it be that with the Type Typ_STUDENT the