• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem retrieving BLOB through resultset

 
Laryssa Fernandes
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a table in Oracle with BLOB data. When I try to retrieve the data using
ResultSet rs=st.executeQuery("SELECT * from NodeTable");

It gives an exception. If I put only the non BLOB column name in the SQL statement, there is no error. But if I put the BLOB column name, it gives the same error as above.
The stack trace is as below:

java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6986)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
at sun.jdbc.odbc.JdbcOdbc.SQLExecDirect(JdbcOdbc.java:3110)
at sun.jdbc.odbc.JdbcOdbcStatement.execute(JdbcOdbcStatement.java:338)
at sun.jdbc.odbc.JdbcOdbcStatement.executeQuery(JdbcOdbcStatement.java:253)
at summ.Main.main(Main.java:79)
 
Paul Clapham
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That would be because the JDBC-ODBC driver doesn't support BLOB columns. But you're using an Oracle database, right? Then why not use the Oracle JDBC driver which goes with it? That driver would surely support BLOBs.
 
Brian Enochson
Greenhorn
Posts: 14
Java Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also retrieving a blob takes special handling. Here is some example code I have used, there are probably many examples out there if you want to Google them. And Paul is right, you want to use the Oracle JDBC Driver if your application is always going to use Oracle.




Brian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic