How to store and retrieve image in a MsAccess DB using JDBC

I want to store images in a MsAccess DB using JDBC and also want retrieve them from DB. please don't tell to store the path of image..I want to store the image not the path...pls reply..thanx in advance

zakircse, you should read more about Java's API.
import java.io.*;
import java.sql.*;
import java.util.Properties;
import java.awt.*;
import javax.swing.*;
public class ImageDemo{
public static void main(String argv[]){
try{
String url="jdbc:access:/c:/test";
Class.forName("com.hxtt.sql.access.AccessDriver").newInstance();
Properties properties=new Properties();
Connection connection = DriverManager.getConnection(url,properties);
Statement stmt = connection.createStatement();
stmt.execute("create database if not exists imagedatabase;");
connection.setCatalog("imagedatabase.mdb");
stmt.execute("create table if not exists imagetable (imageid int,IMAGE_DATA blob);");
File file=new File("c:/pic.jpg");
FileInputStream in=new FileInputStream(file);
PreparedStatement ps=connection.prepareStatement("insert into imagetable (imageid,IMAGE_DATA) values(?,?);");
ps.setInt(1,1234);
ps.setBinaryStream(2,in,(int)file.length());
ps.execute();
ps.close();
ResultSet rs =stmt.executeQuery("select IMAGE_DATA from imagetable where imageid=1234");
byte[] imgbytes=null;
if(rs.next()) {
imgbytes=rs.getBytes(1);
rs.close();
stmt.close();
connection.close();
if(imgbytes!=null){
JFrame fr = new JFrame();
fr.setTitle("Simple Demo for Load Image from MS Access");
Image image = fr.getToolkit().createImage(imgbytes);
fr.getContentPane().add(new PaintPanel(image));
fr.setSize(200,400);
fr.setVisible(true);
Thread.sleep(10000);
System.exit(0);
catch( SQLException sqle )
do
System.out.println(sqle.getMessage());
System.out.println("Error Code:"+sqle.getErrorCode());
System.out.println("SQL State:"+sqle.getSQLState());
sqle.printStackTrace();
}while((sqle=sqle.getNextException())!=null);
catch( Exception e )
System.out.println(e.getMessage());
e.printStackTrace();
class PaintPanel extends JPanel {
private Image image;
public PaintPanel(Image image) {
this.image = image;
public void paintComponent(Graphics g) {
super.paintComponent(g);
g.drawImage(image, 0, 0, this);
}

Similar Messages

  • How to store and retrieve image in a apache derby using JDBC

    hi all
    this is source code i copy and modify but get error message like this
    import java.io.*;
    import java.sql.*;
    import java.util.Properties;
    import java.awt.*;
    import javax.swing.*;
    public class ImageDemo{
    public static void main(String argv[]){
    try{
    String url="jdbc:derby:derDB2";
    Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
    Properties properties=new Properties();
    Connection connection = DriverManager.getConnection(url,properties);
    Statement stmt = connection.createStatement();
    stmt.execute("create database if not exists imagedatabase");
    stmt.execute("create table if not exists imagetable (imageid int,IMAGE_DATA blob)");
    File file=new File("c:\\c.jpg");
    FileInputStream in=new FileInputStream(file);
    PreparedStatement ps=connection.prepareStatement("insert into imagetable (imageid,IMAGE_DATA) values(?,?)");
    ps.setInt(1,1234);
    ps.setBinaryStream(2,in,(int)file.length());
    ps.execute();
    ps.close();
    ResultSet rs =stmt.executeQuery("select IMAGE_DATA from imagetable where imageid=1234");
    byte[] imgbytes=null;
    if(rs.next()) {
    imgbytes=rs.getBytes(1);
    rs.close();
    stmt.close();
    connection.close();
    if(imgbytes!=null){
    JFrame fr = new JFrame();
    fr.setTitle("Simple Demo for Load Image from MS Access");
    Image image = fr.getToolkit().createImage(imgbytes);
    fr.getContentPane().add(new PaintPanel(image));
    fr.setSize(200,400);
    fr.setVisible(true);
    Thread.sleep(10000);
    System.exit(0);
    catch( SQLException sqle )
    do
    System.out.println(sqle.getMessage());
    System.out.println("Error Code:"+sqle.getErrorCode());
    System.out.println("SQL State:"+sqle.getSQLState());
    sqle.printStackTrace();
    }while((sqle=sqle.getNextException())!=null);
    catch( Exception e )
    System.out.println(e.getMessage());
    e.printStackTrace();
    class PaintPanel extends JPanel {
    private Image image;
    public PaintPanel(Image image) {
    this.image = image;
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    g.drawImage(image, 0, 0, this);
    and this is the error message
    Syntax error: Encountered "database" at line 1, column 8.
    Error Code:30000
    SQL State:42X01
    ERROR 42X01: Syntax error: Encountered "database" at line 1, column 8.
         at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
         at org.apache.derby.impl.sql.compile.ParserImpl.parseStatement(Unknown Source)
         at org.apache.derby.impl.sql.GenericStatement.prepMinion(Unknown Source)
         at org.apache.derby.impl.sql.GenericStatement.prepare(Unknown Source)
         at org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext.prepareInternalStatement(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
         at org.apache.derby.impl.jdbc.EmbedStatement.execute(Unknown Source)
         at ImageDemo.main(ImageDemo.java:28)

    It's complaining about this SQL in your code:create database if not exists imagedatabaseThat doesn't exactly look right to me. And perhaps "database" is a reserved word and can't be used in that position. At any rate I would recommend you create your database and tables in some other way before you write Java code to use them. Does Derby have a command-line interface or a GUI manager program? Use them if they exist to set up your tables.

  • How to store and retrieve images from database...

    Hi All
    Anubody tell me plz how to store images in database using jsp.
    and how to retrieve tme.
    Plz reply...
    Anurag

    Exactly
    try the links below may be those might help u in store and retrieval any kind of file.
    http://www.mysqltalk.org/insert-blob-example-vt112861.html
    https://java.sun.com/j2se/1.5.0/docs/guide/jdbc/blob.html
    http://javaalmanac.com/egs/java.sql/GetBlob.html
    http://publib.boulder.ibm.com/infocenter/idshelp/v10/index.jsp?topic=/com.ibm.jdbc.doc/jdbc142.htm
    and a dearly advice friend please query google b4 you post any query out here.

  • 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]

  • LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7?

    LRv3.2 Networking with an Asst , How to store and retrieve updated work on Win7 Network?
    We have a working 1gig network in Win7 PRO 64-bit.  and using LRv3.2
    * How do I configure our Files or Cataloges "so"  ALL Edits are veiwable/edit to all?   (we don't work on the Same Shoot/Folder at the same time)
    I NEED to see,  ALL the LR  Edits  (is great with DNG files
    *** BUT,  what I cannot see if I remember correctly (with just the DNG sharing)  is the  CROP or Virtual Copys ... possibly the Brush edits.
    HOW, do I configure to be able to read and edit ...  ALL of the updated/saved  Edits???   (after it is done by my asst.)
    Is creating a New Catalog for EACH  shoot the way to go?   (not sure I like this idea)
    Right now everything is in one(1) catalog  ... and it's getting big ... BUT, this allows us to search , and group ... going way back.
    Would be nice to be able to still do this easily, and with what we have already done.
    With our one BIG Catalog ... not sure if two(2) can access this catalog over the Network at the same time?
    Even though we never Edit the Same Folder or Files at the same time.
    Or will that be a problem over a simple Win7 PRO network?
    Thank you,
    HG

    Aloha Bob,
    Saw your link.  thank you.
    At least I don't feel "alone"  LOL
    At this point ... I am looking for a  "cluncky"   Work Around?
    * I was thinking,  Maybe making a copy of  My Cataloge ...
    Deleting ALL the  Folders in LR  ... except for the one's  that  will be worked by the Asst.
    Then moving that file to the  Asst.  Computer.
    * NEXT,  pointing the  Folder that they are working on ... across the Network to the Servers Files.
    * After they work on it:
    *** IS THERE A WAY ...
    * To  take that Cataloge ... and UPDATE  my Main  Cataloge.
    THIS, is the STEP  ... I don't know how to do.
    Can someone Help me with this?
    Step by Step,  because I am clueless ....
    Talking UPDATE of everything worked on ... including   Virtual copys, and  CROPS.
    Thank you,
    HG

  • How the store and retrieval in ServletContext will happen??

    Hello Sir,
    I am developing a chat application thats in Swing & servlets Now I am able to authenticate user and I am using ArrayList to maintain the names of the user globally my storing it in ServletContext
    How to store and retrieve ArrayList from Servletcontext
    And another thing is that we are having personal chat(1-to-1) also. But how to use the thread model is not known to us as we have not faced such a situation before
    So if you could suggest some example code or snippets ot certain links then it would be of great help to us
    Thanks
    Regards
    Monarch

    Hello
    thanks for your reply. Actually we are doing the same thing that u have mentioned in your reply.
    The thing we are trying to do is that when a user is logged in the particular servlet which is responsible for the authentiacation of the user will authenticate the user an then calls method in the Chatter class which is outside the servlet
    The Chatter class declares two mwthods addChatter() and getChatter()
    I am managing the currently logged users in Arraylist using this two mehtods above
    When the first user logs in his entry gets stored at the first position in the arraylist but when other user logs in then his entry overrites the entry of the first user instead of getting stored in the next position.
    The arraylist gets initialized when second user logs in. to overcome this problem i want to store the arraylist into the ServletContext so it will be unique for the whole application and will not get initialized
    So I want to know the process of storing and retrieving the arraylist fro the context
    Hope ull understand me and reply me
    Thanks
    Regards
    Monarch

  • Want to store and retrived  images  in the BFILE format using inter media

    I want to store and retrived images in the BFILE format using inter media.I found a article in the oracle site that Oracle interMedia image supports BFILEs.But this article is not demonstrating the use of BFILEs.Please help me to findout the solution.
    Thanks in advance.
    null

    The advantage to using BFILE storage for your is that it's an easy way for Oracle
    Multimedia to access your images without importing them into the database.
    The disadvantages are that the images are read-only. If you want to scale an image or
    convert to a different format, you will need to create a destination image to hold the result. This
    will necessarily be a BLOB based image.
    Adding images is difficult to do from within an application program. Generally you would add new images to a file system that is accessible to the Oracle Database, then insert new rows in your table with appropriate BFILE pointers to the new images.
    BFILE images require separate backup from the database. Also there is not way to transactionally coordinate your BFILE data with your relational data.
    If you are using Oracle 11g, you can use the SecureFile option for BLOB storage. This is much faster then the previous BLOB storage (now called BasicFile) and much faster then BFILE also.
    That said, below is a code snippet that shows how to insert a BFILE based image, set it's properties, show it's properties and select the BFILE locator to access the content. You would need to use the DBMS_LOB package (in PL/SQL) to read the content. From other APIs, (e.g., Java) you would need to use the proper interfaces to access the BFILE.
    Note that you need change the USER, PASSWORD fields in the code. Also you should change the directory location and image name for your use.
    -- create a directory object indicating where the images are stored;
    create or replace directory imgdir as '/tmp';
    -- and grant permission to read to a user;
    grant read on directory imgdir to <USER>;
    conn <USER>/<PASSWORD>;
    -- create the images table
    create table images(id integer primary key, image ordsys.ordimage);
    set serveroutput on
    declare
    obj ordsys.ordimage;
    begin
    -- use the init('FILE', <SRC_LOCATION>, <SRC_FILE>) function
    -- to create an ORDIMAGE object with a BFILE source
    insert into images(id, image)
    values(1, ordimage.init('FILE', 'IMGDIR', 'wizard.jpg'))
    returning image into obj;
    -- lets see if the image source is local or not
    if(obj.isLocal()) then
    dbms_output.put_line('image source is local');
    else
    dbms_output.put_line('image source is NOT local');
    end if;
    -- set the properties of the image object
    obj.setProperties();
    -- and update the row
    update images set image=obj where id=1;
    commit;
    end;
    column height format 99999
    column width format 99999
    column mimetype format a30
    column length format 999999
    -- let's see what we have
    select t.image.getHeight() as "height"
    , t.image.getWidth() as "width"
    , t.image.getMimetype() as "mimetype"
    , t.image.getContentLength() as "length"
    from images t
    -- fetch a BFILE handle to the content
    declare
    bf BFILE;
    length number;
    begin
    select t.image.getBfile() into bf
    from images t
    where t.id=1;
    -- use the DBMS_LOB interface to find out size of image
    length := dbms_lob.getLength(bf);
    dbms_output.put_line('length of BFILE is ' || length);
    end;
    ---What we get when we run the code
    Connected.
    Directory created.
    Connected.
    Table created.
    image source is NOT local
    PL/SQL procedure successfully completed.
    height     width mimetype               length
    399     485 image/jpeg          92552
    length of BFILE is 92552
    PL/SQL procedure successfully completed.
    SQL>

  • Store and retrieve image in database using WD Java

    Hi All,
    I have to store and retrieve an image in oracle database. I have gone through the below blog and forum...
    How to display an image, which is stored in a database?
    The specified item was not found.
    I am able to store image in byte format(oracle data type BLOB) and when i try to retrieve it i am not getting the image....Sorry for my poor technical knowledge.
    can some body help me, please......
    Regards,
    G.

    Hi,
    my code is working... I am able to upload and retrieve the image. But now I am getting the below exception...
    Exception from image insert>> java.sql.SQLException: Data size bigger than max size for this type: 6770
    Below is the code I am uing...
    ConnectDataBase condb=new ConnectDataBase();
        IWDMessageManager mgnr=wdComponentAPI.getMessageManager();
         IPrivateDBImageView.IVn_FileElement  fileelement =
                                  wdContext.nodeVn_File().getVn_FileElementAt(0);
                             IWDResource resource=wdContext.currentContextElement().getResource();
    InputStream in=resource.read(false);
    ByteArrayOutputStream bOut=new ByteArrayOutputStream();
                             int lenght=0;
                             byte part[]=new byte [ 50000 ];
                             while((lenght=in.read(part))!=-1)
                             bOut.write(part,0,lenght);     
              Statement  stmnt=null;
                   Connection con=null;
                   String strQuery=null;
                   String strProp_Details=null;
                   try {
                        con=condb.getConnection (mgnr);
                        stmnt=con.createStatement();
                   PreparedStatement pst=con.prepareStatement("insert into VMS_Image values(?,?,?)");
                        pst.setInt(1,4);
                        pst.setString(2,"srinu1234");
                        pst.setBytes(3,bOut.toByteArray());
                        pst.execute();
                        bOut.close();
                        in.close();
                        mgnr.reportSuccess("Inserted");
                   catch (SQLException e) {
         mgnr.reportException("SQLException from image insert>>"+e,false);
                   catch(Exception e)
                             mgnr.reportException("Exception from image insert>>"+e,false);     
                        finally
                        try
                        if(stmnt!=null)
                             stmnt.close();
                             stmnt=null;     
                        if(con!=null)
                             con.close();     
                             con=null;
                        catch(Exception e)
                             mgnr.reportException("Exception in Closing from image insert>>"+e,false);
    first I used byte of 101024, then 501024 and finally tried with byte of 50000. I am getting the above exception if the image size is more than 4kb....
    Regards,
    Srinivas.
    Edited by: srinivas sistu on Aug 1, 2008 2:26 PM
    Edited by: srinivas sistu on Aug 1, 2008 2:34 PM

  • How to store and retrieve XML messages in AQ using ESB/ BPE

    Hello,
    I am having a requirement which I feel should be fairly common - store and retrieve XML messages in AQ. However, I am struggling to decide which type of queue to use AQ or JMS...Here is the requirement
    1. In an ESB, I want to read different kind of files using file adapter. Different kind as in, having different structure or schema
    2. I want to create a queue that is capable of storing any kind of xml data. To this queue, I want to enqueue the message read in step 1.
    3. In another process, say a BPEL, I want to dequeue the message and write into a file. The filename is retrieved from one of the header properties. I want to dequeue using a stored procedure, not by using a JMS or AQ Adapter (reason being that these adapters poll the queue, and consume a message immediately. However, I want to consume the message only when there is a business need)
    My questions are:
    1. What kind of queue I should create in the DB (What should be its payload type...XMLType? )... I guess the answer would also determine the adapter to be used - JMS or AQ
    2. How I should map the xml data read from the file in step 1 to this adapter
    Any help is highly appreciated.

    You are right in suggesting that I dont need to store my XML data as xml in the DB...I dont want to too :) but its just that, thats the only option I can see at this time (the other track i am exploring is :
    File adapter(XML) -&gt; Convert to opaque (base64binary) -&gt; Enqueue opaque to JMS (aq$_jms_bytes_message) -&gt;Dequeue Opaque -&gt; Write file opaquely.
    In this I have hit the roadblock in trying to convert XML to base64binary...maybe some custom java function is needed...anyway)
    Coming back to this thread, where I am trying the following
    File adapter(XML)  -&gt; Enqueue as XML to queue  -&gt;Dequeue XML -&gt; Write file opaquely.
    PS: I think its important for me to mention that I am using SOA 10.1.3.1.0
    I tried the steps you gave...after creating the queue, I am trying to create a JMS adapter. But the queue I created doesnt show up in the browse window of destinations for the JMS Adapter..That had led me to infer that JMS adapter cant be used
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_row_type AS OBJECT
    (update_queue_id NUMBER
    ,upc VARCHAR2(20)
    ,price1 NUMBER);
    {color}
    {color:#99cc00}CREATE OR REPLACE TYPE batchupdate_rec_type AS VARRAY(9999999) OF batchupdate_row_type;
    CREATE OR REPLACE TYPE payload_type AS OBJECT ( payload batchupdate_rec_type);
    EXECUTE DBMS_AQADM.CREATE_QUEUE_TABLE ( queue_table =&gt; 'jmsuser.batch_update_queue_table', queue_payload_type =&gt; 'payload_type');
    EXECUTE DBMS_AQADM.CREATE_QUEUE ( queue_name =&gt; 'batch_update_queue', queue_table =&gt; 'jmsuser.batch_update_queue_table');
    EXECUTE DBMS_AQADM.START_QUEUE ( queue_name =&gt; 'batch_update_queue'); {color}
    I also needed some opinion on whether the last step of my proposed solution ( Dequeue XML -&gt; Write file opaquely) is possible. As I want to develop a service oblivious of the structure of the file, I dont want to create a file adapter based on a particular xsd...so I want to write whatever xml I am getting from the queue....is this step possible

  • How to store and retrieve chinese characters

    Hi, I am facing some problem in storing and retrieving of chinese characters from oracle,9i .
    This is the character i am trying to store into the database
    自动提款机网络
    while trying to retrieve it, it shows
    自?提款机网?
    ^ ^
    you can see the weird characters like ? at some places.
    here is the sample code which i can using to store and retrieve data from the database
    class testInsert
    public static void main(String[] args)
    try {
         DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());
         Connection conn = DriverManager.getConnection ("jdbc:oracle:thin:@172.16.6.81:1521:JFPPTDB1", "citi_user", "citi_user");
         int employee_id = 12345;
    String ename = "自动提款机网络";
         oracle.jdbc.OraclePreparedStatement pstmt = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("INSERT INTO employees (employee_id, last_name) VALUES (?, ?)");
         pstmt.setFormOfUse(2, oracle.jdbc.OraclePreparedStatement.FORM_NCHAR);
         pstmt.setInt(1, employee_id);
         pstmt.setString(2, ename);
         pstmt.execute();
    pstmt.close();
    pstmt = (oracle.jdbc.OraclePreparedStatement)conn.prepareStatement("SELECT last_name, employee_id from employees");
    ResultSet rset = pstmt.executeQuery();
              String name = "";
              while(rset.next())
                   name = rset.getString(1);
         int id = rset.getInt(2);
              System.out.println("the name is :"+name);
    catch (SQLException sqe)
              System.out.println("Java SQLException caught, error message="+sqe.getMessage());
    and the table in oracle is
    SQL> desc employees;
    Name Null? Type
    LAST_NAME NVARCHAR2(10)
    EMPLOYEE_ID NUMBER
    I am using classes12.zip for oracle,9i. Is there any database setting that i need to know to retrieve the chinese characters?.
    I have been facing this problem for quite sometime and it makes my life tough. Please help me in solving this issue.
    Thanks
    PD

    hi, can you retrieve the chinese character from your os? When it comes to the wild code of asian character, you should focus on the database/client character setting. you may ask more about it from your dba.
    have a nice weekend!
    eilison
    [email protected]

  • 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 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..

  • Can i store and retrieve image using sql command?

    hi
    the following is what i enter to store image in table using sql*plus
    however i encounter some errors as shown below.
    i wondered if i actually can use sql to store image and retreive image
    or i need other developer beside sql to do.
    create table img_storage
    (id     number primary key,
    image     ORDSYS.ORDImage);
    CREATE or REPLACE procedure ADD_image (tmp_id number, file_name varchar2)
    as
         obj ORDSYS.ORDImage;
         ctx raw(4000) := null;
    begin
         INSERT INTO img_classifier (id, image) VALUES (tmp_id,
         ORDSYS.ORDImage (ORDSYS.ORDSOURCE(EMPTY_BLOB(),
         NULL,NULL,NULL,SYSDATE,NULL),
         NULL,NULL,NULL,NULL,NULL,NULL,NULL));
         COMMIT;
         SELECT image into obj FROM img_storage
         where id = tmp_id FOR UPDATE;
         obj.importFrom(ctx,'FILE','IMGDIR',file_name);
         obj.setproperties();
         UPDATE img_storage
         SET image = obj where id = tmp_id;
         COMMIT;
    end;
    show errors;
    create or replace directory imgdir as 'c:\image\';
    exec add_image(1,'argvseng.jpg');
    BEGIN add_image(1,'argvseng.jpg'); END;
    ERROR at line 1:
    ORA-00001: unique constraint (SYS.SYS_C002717) violated
    ORA-06512: at "SYS.ADD_IMAGE", line 7
    ORA-06512: at line 1
    how to reslove the error as shown above.
    or sql does not support ordsys.ordimage such command.
    hmm very confused ....
    what is the difference bet using blob for image and ordsys.ordimage?

    This has nothing to do with intereMedia.
    This is a basic SQL issue.
    A primary key cannot have duplicate entries in a table as the error message suggests.
    Before you call your peocedure you can delete the row with 1 as the primary key, or call the insert peocedure using a primary key that is not being used.

  • I want to store and retrieve images from a oracle datrabase's BLOB type

    Hi all
    I am using WebLogic and Oracle 10g.I have to store images and retrieve them from a BLOB type.
    Please help .

    Please have a look to the Database Application Developer's Guide - Large Objects
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm

  • IPhone - How to store and retrieve lots of video?

    Hi all,
    What is the best way (from a software design point of view) of storing and retrieving an arbitrary number of videos within an app?
    As an example, say there exists 100 videos. How would I store those videos and how to reference each one? Hard coding them into the app seems the wrong way.
    I'm not sure if I'm thinking along the right lines, but maybe some kind of file which can be read in containing the file names?
    The videos would be bundled along with the app.
    Thanks for your assistance.

    Bundle the video files as a folder within the application resources bundle. You can then list the contents of the folder which will contain only your video files. If you want additional metadata associated with each video, then you will need some kind of accompanying data - plist, text file etc.

Maybe you are looking for

  • Flash 11.3 Installation - Mac OS X 10.7.4

    Hello. I have been using Adobe Flash Player for years, no issues. 11.3 update came around a few weeks ago and my iMac refused to install it. I tried all the obvious fixes. I know I have all the latest software installed and I believe I am installing

  • Sending an Image file via UART

    Hi All, 1. Is it possible to send an image file( .jpg -1080p) from PC to FPGA(ML605 evaluation board) via UART ? 2. .jpg to .hex to .txt then  through hyper terminal ? or any  other way ? Meganadhan  

  • Detailed transaction process documentation?

    Hello, I am working currently on a project based on "Oracle NoSQL" as the head storage unit. I am a bit curious, how ONDB handles their transactions. I have scoured the attached documentation but without success. The only thing I could find were head

  • How do I add contacts with IOS 6

    How do I add contacts to my iPhone 4S with IOS 6?

  • Unable to connect dell xps 802.11ac laptop to cisco 1250 AP?

    I have a new dell xps 15inc with the dell 802.11ac wireless card but it will not connect to the Cisco 1250 AP, however it connect to other APs just fine. I wondering if the Cisco 1250 AP is just to old and if there is any documentation proving this.