• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Exception when reading image( using getBLOB ) from database

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody...

I'm trying to connect to a MS Access database which has a table to store Images using the Jdbc-Odbc bridge driver.

the following code is used to read a row from the table




i get this exception -

java.lang.ClassCastException: sun.jdbc.odbc.JdbcOdbcResultSet

at the line -





any solution for this problem??

thanks in advance
 
Ranch Hand
Posts: 333
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://forum.java.sun.com/thread.jspa?threadID=709363&tstart=0
 
Vijayendra Vishwanath
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks for posting the reply... but it didnt solve my problem..

i have to use MS Access Database.
cant i use Oracle "thin" or "oci" drivers to connect to MS Access DB??

thanks in advance
[ February 17, 2006: Message edited by: Vijayendra Vishwanath ]
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vijayendra

I don't think it is possible to access a MS-Access DB with the Oracle driver.
[ February 17, 2006: Message edited by: Nicolas Stern ]
 
Vijayendra Vishwanath
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Nicolas Stern:
Hi Vijayendra

I don't think it is possible to access a MS-Access DB with the Oracle driver.

[ February 17, 2006: Message edited by: Nicolas Stern ]



how do i sovle the classcastexception that i get when i use jdbc-odbc brigde to connect to Access DB??

thanks in advance
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The previous poster was phrasing things very politely. How about this

Oracle != Access

Just because you found a solution that worked with an Oracle database doesn't mean that you can force it to work with Access. Square peg, round holes and all that...

I'll admit it, in the past, before I discovered MySQL, I used Access
My advice is to use the java.sql.ResultSet method getBinaryStream. I've done it before and I know it works.
 
Police line, do not cross. Well, this tiny ad can go through:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic