I need to insert an image into the oracle db using jdbc.
I'm extracting the image from access db first as getBinaryStream and then inserting the same into oracle Blob data type column.
In access the image is stored in a column with data type OLE Object.
When i did this am geeting an error like
Io exception: InputStream is no longer valid - the Statement has been closed, or the cursor has been moved
Here is the code(for extracting data from Access Db)
public ArrayList<ArrayList<Member>> vSelectAll(ArrayList<String> tablename)
ArrayList<ArrayList<Member>> temp = new ArrayList<ArrayList<Member>>();
String temp_tablename =null;
Iterator it = tablename.iterator();
temp_tablename = (String)it.next();
System.out.println("tablename - "+temp_tablename);
You can not just store blob pointer inputstream in memory. Either you should fetch all the bytes and store it in memory in order to use it in vInsertPhoto method (not good), or you should read some bytes and then write it immediately.
You have to merge your methods into one method that will read one row from Access DB then insert it to Oracle DB.
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss