Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.*

 
Jahnvi Vyas
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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???

Thanks..

Jahnvi
 
Jignesh Patel
Ranch Hand
Posts: 626
Mac
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it should be like this
class mydataclass implements Blob{
// all your blob related stuff
}
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jahnvi,
Often people use get/setBinaryStream to avoid the vendor specific implementations of BLOB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic