This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JDBC and Relational Databases 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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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.
I agree. Here's the link:
subject: How to instantiate Blob?
It's not a secret anymore!