File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and the fly likes How to instantiate Blob? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to instantiate Blob?" Watch "How to instantiate Blob?" New topic

How to instantiate Blob?

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Good day!

To instantiate something, (if I am not mistaken) the code will be:

Now I am trying it on the Blob:

But when I do this, I get a red line under it which says that:

"Cannot instantiate the type Blob".

I am using MS SQL Server.

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Blob is an interface. You can't create an instance of an interface. What are you trying to do: insert binary data or recover it?

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 185
Thanks for the reply. I saw an example for MySQL with that type of instantiation so I thought it would work on mine. Anyways, thanks for the info. I am trying to insert binary data, specifically a text file in the database.

Thanks again.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: How to instantiate Blob?
Similar Threads
Conversion Blob to Byte Array
Conversion Blob to Byte Array
Display BLOB contents to the client
How to convert FormFile into BLOB object?
inserting data in to blob...