Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

store the image in oracle

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi,

When i try to store the image, iam getting one exception like
java.sql.SQLException: ORA-01460: unimplemented or unreasonable conversion requested. In the table, i declared the image field as BLOB data type.
Herewith i have attached my code snippet. just go through this code and say me what is the problem. Iam working in windows - oracle client. but the oracle server in linux. Admin has set the NLS_LANG also. He set the NLS_LANG like AMERICAN_AMERICA.ALUTF8 -something. Database admin is telling that some content is missing in database. I dont know what the content is missing. What i need to check. i raised this question before, they informed, the problem is in database conversion. Could you help me please.


String filename = "d:/commercial.gif";
if (!filename.equals("")) {
PreparedStatement ps = con.prepareStatement("insert into picture (id,picture1) values (?,?)");
ps.setString(1, "imageId");
FileInputStream fis = new FileInputStream(filename);
ps.setBinaryStream(2, fis, fis.available());
ps.execute();
ps.close();
} else {
PreparedStatement ps = con.prepareStatement("insert into picture (id,picture1) values (?, empty_blob())");
ps.setString(1, "imageId");
ps.execute();
ps.close();
}



thanks
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please don't post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
Have a look at our FAQ, HowToAskQuestionsOnJavaRanch
 
Does this tiny ad smell okay to you?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
    Bookmark Topic Watch Topic
  • New Topic