To store and retreive imageicon form oracle

i am able to store imageicon in oracle
but not able to read back
this is the part of code to store and
retreive
public void callupdatescreenview()
try{
SimpleDateFormat dateformat=new SimpleDateFormat("dd/mm/yyyy");
Date date=new Date();
String dat=dateformat.format(date);
java.sql.Timestamp t=new java.sql.Timestamp(date.getTime());
java.sql.Statement stmt,stmtdailyid;
java.sql.ResultSet rs,dailyidrs;
ByteArrayOutputStream bos = new ByteArrayOutputStream();
ObjectOutputStream oos = new ObjectOutputStream(bos);
oos.writeObject(ilog.iImg);
oos.close();
byte[] data = bos.toByteArray();
String dailyid=new String();
String usrnm=new String();
usrnm=(String)serverView.jcbusertimer.getSelectedItem();
stmtdailyid=dbdeclare.serverdbcn.createStatement();
dailyidrs=stmtdailyid.executeQuery("select tDate,usrName,noOfLogs
from logInfo where tDate='"+dat+"'and usrName='"+usrnm+"' order by
noOfLogs");
while(dailyidrs.next())
{  dailyid=dailyidrs.getString(1)+dailyidrs.getString(2)
+String.valueOf(dailyidrs.getInt(3));     }      
serverView.pstmtaddscreen.clearParameters();
serverView.pstmtaddscreen.setString(1,dailyid);
serverView.pstmtaddscreen.setTimestamp(2,t);
serverView.pstmtaddscreen.setObject(3,data);
serverView.pstmtaddscreen.executeUpdate();
stmt=dbdeclare.serverdbcn.createStatement();
rs=stmt.executeQuery("select * from capturescreen where
dailyId='"+dailyid+" '");
while(rs.next()) {
ImageIcon i =(ImageIcon)rs.getObject(3);
serverView.jlblimage.setIcon(i);
catch(java.sql.SQLException sqle) { System.out.println(sqle);}
catch(java.io.IOException sqle) { System.out.println(sqle);}

You need an encoder. Take a look at these;-
com.sun.image.codec.jpeg.*;
com.sun.media.jai.codec.ImageCodec;
com.sun.media.jai.codec.ImageEncoder;
com.sun.media.jai.codec.PNGEncodeParam;
com.sun.media.jai.codec.BMPEncodeParam;
com.sun.media.jai.codec.TIFFEncodeParam;

Similar Messages

  • Can you suggest a best way to store and read arabic from oracle database?

    Hi ,
    can you suggest a best way to store and read arabic from oracle database?
    My oracle database is Oracle Database 10g Release 10.1.0.5.0 - 64bit Production on unix HP-UX ia64.
    NLS_NCHAR_CHARACTERSET AL16UTF16
    NLS_LANGUAGE AMERICAN
    NLS_TERRITORY AMERICA
    NLS_CHARACTERSET WE8ISO8859P1
    I have presently stored the data in nvarchar2 field. But i am not able to display it correctly.

    Using the national characterset should work but there are other factors that you have to consider when working with NCHAR/NVARCHAR2/NCLOB.
    If possible, changing the characterset is usually the best solution if it's a possiblity for you.
    For more info:
    Dear Gurus: Can u pls explain the difference between VARCHAR2 & NVARCHAR2??

  • Store and retreive image/bitmapdata to/from local storage in iOS-app

    I'm trying to store and retreive cam-captured bitmapdata to the local app-space, but after a whole day of searching and trying I can't find any working example.
    It's no problem capturing cam-bitmapdata, but how to store (and retreive).
    Thanks!

    If its just a problem of saving the bitmapdata, follow along:
    http://actionsnippet.com/?p=1093
    Use http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.h tml#applicationStorageDirectory to resolve to the correct location.

  • Urgent : store and retrieve image to oracle database thru applet

    hi all
    i want the code sample for storing the image to oracle database
    development enviornment:
    server : oracle 9i , apache web server
    client : ie6 browser
    i am connecting to oracle database thru applet using oracle jdbc thin driver
    can anyone give me details about storing image to db
    1) what datatype should be used in table for image?
    2) my image files are on client machine... can i directly read those files from browser or first i have to copy those files to server?
    3) .gif files will do or what should be the fileformat?
    4) java code to store it to database (i am using jdk1.3)
    5) how to retrieve it back from database and display it in awt panel ?
    its very urgent ...
    i am doing some r&d and trying to do using blob....
    but it will take some time ...
    i will really be thankful if someone sends detail code....
    thankx in advance ....

    Hi,
    The code below might answer few of your questions.
    There is a restrcition on size of image, it must be less than 4KB.
    //Code to insert image in database
    //mytable is the table name that contains two fields in databse:name,image of type varchar and blob
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con =null ;
    Statement stmt =null ;
    con =DriverManager.getConnection  ("jdbc:oracle:thin:@<hostname>:1521:orclsid", "system","manager");
    PreparedStatement preparedStatement = con.prepareStatement("insert into mytable (name,image) values (?,?)");
    preparedStatement.setString(1,"Amol");
    InputStream inputStream = new BufferedInputStream(new FileInputStream("C:\\WINNT\\Temp\\netscape\\images\\menubg.jpg"));
    preparedStatement.setBinaryStream(2, inputStream, inputStream.available());
    preparedStatement.executeUpdate();
    preparedStatement.close();
    inputStream.close(); To retrieve image,here is the snippet
    ResultSet resultSet = stmt.executeQuery("select image from mytable'");
    if (resultSet.next())
    byte[] image1 = resultSet.getBytes("image");
    FileOutputStream fos=new FileOutputStream("c://splash11.jpg"); //will retrieve bytes and create a file
    //by the name specified
    fos.write(image1);
    -Amol

  • How to store and retrive images in oracle database

    hi,
    i am interested in storing some students pictures ( photos) into my oracle database, and i want to know since the images are considered as binary data and since BLOB and CBLOB and supported by oracle, how to insert and to select the picture from oracle from my swing-based application?
    does anyone have a complete sample or tutorial doing that well!!
    thx

    Mira este link,
    hay varios articulos interesantes.
    http://www.oracle-base.com/articles/9i/Articles9i.php
    tambien puedes consultar este link
    http://tahiti.oracle.com/pls/db92/db92.homepage
    completa los coampos solicitados con la palabra "Images"
    hay un manual de LOBs muy completo

  • How do I store and retreive phots on a "flip phone"?

    I have a Verizon branded LG flip phone that's 3-4 years old? No bells and whistles.
    Is there any way, using this phone, for me to upload pictures from my camera to Verizon
    then download them to me?
    Thanks

    It's an LG VX5600 or it may be a UX5600.
    The only USB port I have is where I put the charger.
    My phone does NOT have an SD card.
    This is a basic phone, as a matter of fact when I bought it, "smart phones"
    were considered only mildly intelligent.
    My phone is not (removed) as it can get to the net but at $1.49 a GB I'm too
    cheap to use it.
    I was just checking, after about 4 years to see IF Verizon had simplified
    the up/downloading
    of pictures.
    Any help you can give I will appreciate.
    McM
    Edited as required by the Verizon Wireless Terms of Service
    Message was edited by: Admin Moderator

  • Store and Display doc/pdf files in the database using Forms

    Hi all,
    How can i store and display doc/pdf files in the database using Forms 10g?.
    Arif

    How to get up and running with WebUtil 1.06 included with Oracle Developer Suite 10.1.2.0.2 on a win32 platform
    Solution
    Assuming a fresh "Complete" install of Oracle Developer Suite 10.1.2.0.2,
    here are steps to get a small test form running, using WebUtil 1.06.
    Note: [OraHome] is used as an alias for your real oDS ORACLE_HOME.
    Feel free to copy this note to a text editor, and do a global find/replace on
    [OraHome] with your actual value (no trailing slash). Then it is easy to
    copy/paste actual commands to be executed from the note copy.
    1) Download http://prdownloads.sourceforge.net/jacob-project/jacob_18.zip
      and extract to a temporary staging area. Do not attempt to use 1.7 or 1.9.
    2) Copy or move jacob.jar and jacob.dll
      [JacobStage] is the folder where you extracted Jacob, and will end in ...\jacob_18
         cd [JacobStage]
         copy jacob.jar [OraHome]\forms\java\.
         copy jacob.dll [OraHome]\forms\webutil\.
      The Jacob staging area is no longer needed, and may be deleted.
    3) Sign frmwebutil.jar and jacob.jar
      Open a DOS command prompt.
      Add [OraHome]\jdk\bin to the PATH:
         set PATH=[OraHome]\jdk\bin;%PATH%
      Sign the files, and check the output for success:
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\frmwebutil.jar
         [OraHome]\forms\webutil\sign_webutil [OraHome]\forms\java\jacob.jar
    4) If you already have a schema in your RDBMS which contains the WebUtil stored code,
      you may skip this step. Otherwise,
      Create a schema to hold the WebUtil stored code, and privileges needed to
      connect and create a stored package. Schema name "WEBUTIL" is recommended
      for no reason other than consistency over the user base.
      Open [OraHome]\forms\create_webutil_db.sql in a text editor, and delete or comment
      out the EXIT statement, to be able to see whether the objects were created witout
      errors.
      Start SQL*Plus as SYSTEM, and issue:
         CREATE USER webutil IDENTIFIED BY [password]
         DEFAULT TABLESPACE users
         TEMPORARY TABLESPACE temp;
         GRANT CONNECT, CREATE PROCEDURE, CREATE PUBLIC SYNONYM TO webutil;
         CONNECT webutil/[password]@[connectstring]
         @[OraHome]\forms\create_webutil_db.sql
         -- Inspect SQL*Plus output for errors, and then
         CREATE PUBLIC SYNONYM webutil_db FOR webutil.webutil_db;
      Reconnect as SYSTEM, and issue:
         grant execute on webutil_db to public;
    5) Modify [OraHome]\forms\server\default.env, and append [OraHome]\jdk\jre\lib\rt.jar
      to the CLASSPATH entry.
    6) Start the OC4J instance
    7) Start Forms Builder and connect to a schema in the RDBMS used in step (4).
      Open webutil.pll, do a "Compile ALL" (shift-Control-K), and generate to PLX (Control-T).
      It is important to generate the PLX, to avoid the FRM-40039 discussed in
      Note 303682.1
      If the PLX is not generated, the Webutil.pll library would have to be attached with
      full path information to all forms wishing to use WebUtil. This is NOT recommended.
    8) Create a new FMB.
      Open webutil.olb, and Subclass (not Copy) the Webutil object to the form.
      There is no need to Subclass the WebutilConfig object.
      Attach the Webutil.pll Library, and remove the path.
      Add an ON-LOGON trigger with the code
             NULL;
      to avoid having to connect to an RDBMS (optional).
      Create a new button on a new canvas, with the code
             show_webutil_information (TRUE);
      in a WHEN-BUTTON-PRESSED trigger.
      Compile the FMB to FMX, after doing a Compile-All (Shift-Control-K).
    9) Under Edit->Preferences->Runtime in Forms Builder, click on "Reset to Default" if
      the "Application Server URL" is empty.
      Then append "?config=webutil" at the end, so you end up with a URL of the form
          http://server:port/forms/frmservlet?config=webutil
    10) Run your form.sarah

  • How to store and retrieve a PDF form to SQL Server from LiveCycle?

    My intention is to save a complete PDF form into a database and then later on retrieve this form from DB.
    To do this, SQL Server has got two datatypes, image or Varbinary(max). I am able to store a PDF using "Execute SQL Statement"(I have written an Insert statement). Some value is being written into DB as well.
    But when I try to retrieve this record using "Query Single Row"(I store the result to a doc variable), the retrieved PDF is of an unknown type and cannot be opened by Adobe Reader.
    I am not sure if my approach is correct. Is it possible to store/retrieve a PDF form to/from a DB through LiveCycle?
    If yes, please give me some guidance.

    hi
    am not sure
    but u can use the same concept as storing image in db and retrieve..
    create a blob column
    parse that pdf and store into that column.
    again u retrieve the content and via file io make the same name with pdf extension..

  • Buttons and text items on oracle forms 6i

    can i create dynamic buttons and text fields on oracle forms 6i.
    i mean when i insert record in database then automatically creat a button on form.
    Regards
    Munawer hussain

    Hi,
    One physical button is enough for a series of "functional buttons" per amount of simultanious visisble buttons. You can change the button prompt at run-time depending on a certain condition. That same condition can also be used when executing the when-button-pressed (wbp) trigger.
    Example:
    suppose you have 2 functions that you want to create buttons for: enter query and execute query. Only 1 button is visible at one time. In design time you create 1 button. In run-time, depending on :system.mode you set the button prompt to "enter query"or "execute query" and in the wbp trigger you write
    begin
    if :system.mode = 'QUERY'
    then
    execute_query;
    else
    enter_query;
    end if;
    end;
    Kind regards
    .

  • How to connect database(oracle 10g) and retreive values using poral 10

    can anyone help me how to connect to database and retreive values in detail and also please post the sample code if u have any.

    Hello
    Thanks for your reply
    I tried to connect and here is the result: see below
    [oracle@ebstailin 11.1.0]$ sqlplus / as sysdba
    SQL*Plus: Release 11.1.0.7.0 - Production on Sat Jul 17 15:35:31 2010
    Copyright (c) 1982, 2008, Oracle. All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> CONNECT apps/apps
    Connected.
    SQL>
    But still cannot connect using ORACLE SQL Developer
    thanks

  • Error While running Oracle Look and feel Template Form -  (LAF_TEMPLATE)

    Forms Version 10.1.2.3
    JRE version 1.6.0_30
    Operating System Windows XP
    I am trying to setup oracle look and feel project on my local machine.
    For that i upgraded forms to 10.1.2.3 then i also applied path no *9593176* (But not yet performed steps related to jacob and webutil).
    Problem : When i run Oracle look and feel template form it comes up with following error.*
    Forms Applet version is : 10.1.2.3
    Exception in thread "thread applet-oracle.forms.engine.Main-1" java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet;
         at oracle.forms.fd.DrawLAF.init(DrawLAF.java:285)
         at oracle.forms.handler.UICommon.instantiate(Unknown Source)
         at oracle.forms.handler.UICommon.onCreate(Unknown Source)
         at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
         at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
         at oracle.forms.engine.Runform.processMessage(Unknown Source)
         at oracle.forms.engine.Runform.processSet(Unknown Source)
         at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
         at oracle.forms.engine.Runform.onMessage(Unknown Source)
         at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
         at oracle.forms.engine.Runform.startRunform(Unknown Source)
         at oracle.forms.engine.Main.createRunform(Unknown Source)
         at oracle.forms.engine.Main.start(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)

    Hello,
    I have spent a lot of time to indicate wherever I could that you don't have to ask questions about the LAF on this forum. You have two other different locations, a dedicated email and a dedicated forum.
    At the first sight, it seems that you have not used the laf_10123.jar in your archive tag.
    Thank you,
    Francois

  • How to store images and video clips in Oracle

    All,
    Can anyone guide me how to store the images and video clips in oracle through pl/sql and also the way to retirve it.
    Edited by: sikander on Sep 7, 2010 3:27 AM

    Some sample code
    connect sys schema  --if scott has no privs to create directory
    --where physical file store in the same machine where database load
    CREATE DIRECTORY IMAGES AS 'D:\images';
    GRANT READ ON DIRECTORY IMAGES TO SCOTT;
    connect scott/tiger
    create table my_book_diagrams (Image BLOB);
    DECLARE
      v_file_loc BFILE;
      v_diagram_loc BLOB;
      v_diagram_size INTEGER;
    BEGIN
      v_file_loc := BFILENAME('IMAGES','Layout.bmp');
      DBMS_LOB.FILEOPEN(v_file_loc );
      v_diagram_size := DBMS_LOB.GETLENGTH(v_file_loc);
      INSERT INTO my_book_diagrams (Image) VALUES (EMPTY_BLOB())
      RETURNING image INTO v_diagram_loc;
      DBMS_LOB.LOADFROMFILE(v_diagram_loc, v_file_loc, v_diagram_size);
    END;
    commit;

  • Running forms 6i and reports 6i from oracle portal

    hi all,
    is it possible to run the forms and the reports developed in
    forms 6i and reports 6i from oracle portal
    or
    is it possible to export forms 6i and reports 6i into oracle
    portal
    prabhakaran

    Dear Friend,
    It is possible to deploy 6i forms & reports by Apache Web
    Listener. You will have to edit the httpd.conf configuration
    file and add your virtual path as Alias. The Virtual Paths are
    /dev60html/
    /dev60cgi/
    /jinitiator/
    /dev60temp/
    Reply me if youre are successful.
    Thanx.

  • Error when changing password of NW J2ee's secure store and Oracle sqlplus

    Hi all,
    I am wondering on the following:
    Current setting:
    I have "old_password" for J2ee configtool's secure store.
    I have "old_password" for Oracle's sapsr2 user inside Sqlplus.
    When I change the password for all 3 place from "old_password" to "new_password", I am not able to connect to configtool. I am also not able to start the Portal service; with logfile error "invalid user/password"
    If I change the password back to "old_password", I can connect to configtool as well as start the service.
    Snote and forumers (google) mention that update configtool's secure store and "alter user sapsr3" for Oracle database is all I need to change password.
    Have I miss out some step in order to change the password for my Enterprise Portal?
    Thank you.
    Regards

    edit: never mind, found the meaning of SDM.
    but the command below, is it usable?
    For Windows OS:
    Open a command prompt and navigate to the folder <Drive>:\usr\sap\DP1\JC21\SDM\program
    Execute the below commands:
    sdm jstartup "mode=standalone"
    sdm changepassword "newpassword=<Enterthenewpassword>"
    sdm jstartup "mode=integrated"
    StartServer.bat
    Edited by: Sek Yao Ooi on Dec 7, 2009 9:21 AM

  • How to store and retrieve blob data type in/from oracle database using JSP

    how to store and retrieve blob data type in/from oracle database using JSP and not using servlet
    thanks

    JSP? Why?
    start here: [http://java.sun.com/developer/onlineTraining/JSPIntro/contents.html]

Maybe you are looking for

  • Is there a keylogger or tracker on my computer?

    Hi, I have reason to belive there might be some sort of spying software/keylogger installed on my computer without my consent. I am 18 and the laptop I'm using was purchased for me by my mother about a year or two ago. She's one of those paranoid mot

  • My photos will not sync, "required file not found"

    I already deleted the iPod Photo Cache (twice) and this did not fix my problem!

  • Kobo ereader does not appear as connected device

    I want to copy ebooks from ADE on my Laptop to a kobo glo but the kobo is not listed as a device when activating ADE after connecting kobo to laptop?

  • Up-to-date page not accepting serial number

    I bought a new Mac from the Apple Online Store on 29th June.  It is all registered and showing up as such on the Applecare look-up page. When I now go to the Lion up-to-date page to try and retrieve my upgrade, it gives me the error message: "Sorry,

  • Headings: folders vs topics

    I'm currently trying to create printed documentation from existing online help. There is only one problem to which the answer eludes me: while RoboHelp automagically sets folder/subfolder headings to Heading1, Heading2 etc, it doesn't seem to do the