• Post Reply 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

Blob?

 
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi all,

i'm trying to retrive a pic from the database using the getBlob method but the following exception pops up :

java.lang.UnsupportedOperationException

at sun.jdbc.odbc.JdbcOdbcResultSet.getBlob(JdbcOdbcResultSet.java:4390)



and i don't know what it's mean . any way this is my code that i use to retrive the picture :


public byte[] getBlob() throws SQLException {
String SQLCommand = "SELECT user_pic FROM USERS where user_id = ? ";
dbUtil.openConnection();
Blob blob = null;
byte[] bytes = null;
PreparedStatement pstmt = dbUtil.prepareStatement(SQLCommand);
if (pstmt == null) {
throw new SQLException("Erorr In Preparing Update Statement In UsersDAO");
}
pstmt.setInt(1, 1010);
ResultSet rs = pstmt.executeQuery();
//ResultSetMetaData md = rs.getMetaData();
while (rs.next()) {
blob = rs.getBlob(1);
}
bytes = blob.getBytes(1, (int) (blob.length()));
dbUtil.closeConnection();
return bytes;
}





any one can help me ?? please i realy need help


thanx in advance.
[ June 11, 2005: Message edited by: Bear Bibeault ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The error message means exactly what it says: that the getBlob() method is unsupported by your driver. You could change drivers to one which does support this method. What database are you using?
 
moh sak
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi thanx for you'r replay , i'm using microsoft sql server .

is there any way to do it ? i'm using the jdbc dbc bridge !!???
reply
    Bookmark Topic Watch Topic
  • New Topic