It's not a secret anymore!
The moose likes JDBC and Relational Databases and the fly likes java.sql.* Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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
author & internet detective

Joined: May 26, 2003
Posts: 33107

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

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
I agree. Here's the link:
subject: java.sql.*
It's not a secret anymore!