3

I am trying to insert text,images,audio and video files into an oracle 9i database.The oracle driver used is also supported so no problems with that.It easily uploads files upto 5KB. If my file exceeds 5 kb its giving me this oracle error.

unimplemented or unreasonable conversion requested!

I am not understanding why this is happening Because of this i am unable to fulfill my requirements of storing multimedia files with a larger size. its showing me the oracle error in this line :

    int row = pmt.executeUpdate();

here is my code :

pmt = con
                    .prepareStatement("insert into image_mode_idea(data_id,idea_id,file_name,file_format,file_data) values(?,?,?,?,?)");
            pmt.setInt(1, data_id);
            pmt.setInt(2, idea_id);
            pmt.setString(3, fileName);
            pmt.setString(4, fileFormat);
            out.println("whatsup"+inputStream);
            if (inputStream != null) {
                out.println("Before Set the Input Stream: " + inputStream);
                System.out.println(pmt);
                pmt.setBinaryStream(5, inputStream, inputStream.available());
                System.out.println(pmt);
                out.println("Set the Input Stream: " + inputStream);
            } else {
                out.println("Input Stream Null");
            }
            System.out.println(pmt);
            int row = pmt.executeUpdate();

Any kind of help is appreciated at the earliest.

Ekta Shah
  • 31
  • 2
  • have you tried image compression??? try to compress the image or resize it before insert. or try to upgrade your DB to 11g...probably that might help... – Fr_nkenstien Apr 16 '13 at 05:17
  • also y dont you insert the link to the image file in your db and keep the actual image on the disk..?? will that satisfy your requirement..? – Fr_nkenstien Apr 16 '13 at 05:18
  • I have certain limitations as in,I cannot change the software versions i m using, as it is a small scale project and even cannot save the links.i need to save the images in a binary format! – Ekta Shah Apr 16 '13 at 05:27
  • 1
    try this link for image compressions..http://www.coderanch.com/t/526224/java/java/Image-Compression.. similarly u can look for image decompression... – Fr_nkenstien Apr 16 '13 at 05:31
  • But its not just about images.Images can be compressed i got that but audio and video thry are not even getting stored coz they cannot be around 5KB in size.This is the major issue. – Ekta Shah Apr 16 '13 at 05:37
  • have you checked if oracle 9i even supports data larger than 5 KB..because if it doesn't then i suppose you are against a hard wall and need some work around.. also please check "Show parameter db_block_size" this is a DB parameter and if it is defined as 5k then you have to modify that... – Fr_nkenstien Apr 16 '13 at 05:43
  • the db block size is set to more than 5 K..... – Ekta Shah Apr 16 '13 at 05:57
  • there is some more information about the error available at http://www.dba-oracle.com/t_ora_01460_unimplemented_or_unreasonable_conversion_requested.htm There is an answered question about it - http://stackoverflow.com/questions/11036300/ora-01460-unimplemented-or-unreasonable-conversion-requested-due-to-r-n-in-sel and a still unanswered one - http://stackoverflow.com/questions/15972476/ora-01460-unimplemented-or-unreasonable-conversion-requested-blob-insert – SpaceTrucker Apr 16 '13 at 06:19
  • none of the above suggested links are helping me solve the error. – Ekta Shah Apr 16 '13 at 07:52
  • And its not a duplicate question at all! – Ekta Shah Apr 16 '13 at 08:00
  • Have you tried the approach suggested in the duplicate question? If for some reason your problem is different, I'll be happy to vote for a re-open. – Frank Schmitt Apr 16 '13 at 08:19
  • The methods that have been suggested in the other question are not a solution to the error i am facing!i have already written and retrieved data from the blob,the issue wid the code is that it is not taking in larger data in the database.Because of which i am getting that oracle error which needs to be solved. – Ekta Shah Apr 16 '13 at 11:50

0 Answers0