Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
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
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Java in General
Please help : toByteArray(myBlob) fails ???
achana chan
Ranch Hand
Posts: 277
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I hope Michael reads this...
I am trying
public byte[] empPicture
as suggested.
On the input side (where I am getting the record from Oracle) I now changed the code to this :
// // ----------------- // public empRecord query(int empno) { empRecord thisRec = null; try { prepStmt.setInt(1, empno); // placeholder for "?" in position 1 ResultSet rset = prepStmt.executeQuery(); System.out.println("\n<<ORA>>AllEmpTN : executed prepStmt, record : "); if (rset.next()) { // Create a new record object... thisRec = new empRecord(); // // Set the values... thisRec.empno = rset.getInt("empno"); thisRec.ename = rset.getString("ename"); thisRec.fname = rset.getString("fname"); thisRec.job = rset.getString("job"); thisRec.mgr = rset.getInt("mgr"); thisRec.hiredate = rset.getDate("hiredate"); thisRec.sal = rset.getDouble("sal"); thisRec.comm = rset.getDouble("comm"); thisRec.deptno = rset.getInt("deptno"); [B]BLOB picBLOB = ((OracleResultSet) rset).getBLOB("picture"); thisRec.picture = toByteArray(picBLOB);[/B] :confused: // System.out.println(thisRec.ename+","+thisRec.fname+","+thisRec.job+","+thisRec.mgr+","+ thisRec.hiredate+","+thisRec.sal+","+thisRec.comm+","+thisRec.deptno); } } //end of try-block catch (SQLException ex) // catch(Exception ex) { ex.printStackTrace(); thisRec = null; } // okay, let's have a look at the record... return thisRec; } //end of method empQuery();
humanum errare est.
achana chan
Ranch Hand
Posts: 277
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thread
closed.
I managed to fix it on the hint that Michael gave me about using
public bytearray[] empPicture
instead of Blob.
Thank you !
humanum errare est.
snakes are really good at eating slugs. And you wouldn't think it, but so are tiny ads:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
paint(Graphics gr) returns nullpointerexception ?
JSP error: invalid arguments in call . PLEASE HELP
Nested Reslutsets
Need Code Review
Displaying an Oracle BLOB image.
More...