aspose file tools*
The moose likes JDBC and the fly likes Exception when reading image( using getBLOB ) from database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Exception when reading image( using getBLOB ) from database" Watch "Exception when reading image( using getBLOB ) from database" New topic
Author

Exception when reading image( using getBLOB ) from database

Vijayendra Vishwanath
Greenhorn

Joined: Jan 10, 2006
Posts: 5
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
stu derby
Ranch Hand

Joined: Dec 15, 2005
Posts: 333
http://forum.java.sun.com/thread.jspa?threadID=709363&tstart=0
Vijayendra Vishwanath
Greenhorn

Joined: Jan 10, 2006
Posts: 5
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 ]
Nicolas Stern
Ranch Hand

Joined: Apr 26, 2002
Posts: 57
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

Joined: Jan 10, 2006
Posts: 5
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
Jeff Albertson
Ranch Hand

Joined: Sep 16, 2005
Posts: 1780
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.


There is no emoticon for what I am feeling!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception when reading image( using getBLOB ) from database