This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes java.sql.* Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "java.sql.*" Watch "java.sql.*" New topic


Jahnvi Vyas
Ranch Hand

Joined: May 03, 2006
Posts: 36

In my web application I am using MySql as back-end. One of the column type in my table is BLOB. I am fetching some values in Blob of JSP tag and then passing those in sql query. But I am getting initialization error. Because as per java.sql.* package Blob is an interface. So that object cant be created for that.

So is there any way to initialize some values?? How to declare or use this type???


Jignesh Patel
Ranch Hand

Joined: Nov 03, 2001
Posts: 626

it should be like this
class mydataclass implements Blob{
// all your blob related stuff
Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30130

Often people use get/setBinaryStream to avoid the vendor specific implementations of BLOB.

[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
jQuery in Action, 2nd edition
subject: java.sql.*
Similar Threads
creating and inserting Blob
insert blob into DB - row containing the LOB value is not locked
How to pass BLOB to a PL/SQL Stored Procedure
storing BLOB
How to convert FormFile into BLOB object?