blob update

  • Thread starter Thread starter Lance Johnson
  • Start date Start date
L

Lance Johnson

I'm writing a query to update a blob field in my table. From what I've seen
the only way to do this is with a parameterized query. Is this correct? If
so that sucks because we're not tied to one specific db provider and we have
to write a separate one for each dbtype then, since there's no real
interface/base class for a command object.

Lance Johnson
 
AFAIK, your correct. However, this is the type of problem a Factory pattern
can take care of for you. It's a little mroe code but nothing too dramatic.
 
Thanks for William's quick response.

Hi Lance,

Thank you for posting in the community! My name is Kevin, and I will be
assisting you on this issue.

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to update a BLOB field in the
database table and would like the update function apply to all databases.
If there is any misunderstanding, please feel free to let me know.

Based on my experience, the way in your post is correct. Although
IDbCommand is the interface for command classes, we have to write a
separate parameterized query for each type of database. Because the way of
updating each database differs from each other. William has provided a good
idea of using Factory pattern to take care of. Factory pattern is a kind of
commonly used design patterns. It is used to produce similar objects with
some differences with one interface. For more information about Factory
pattern and other design patterns, please check the book Design Patterns,
Elements of Reusable Object-Oriented Software by Addison-Wesley.

Does this answer your question? If anything is unclear, please feel free to
reply to the post. I am standing by to be of assistance.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Lance,
It is possible to use stored procedures and then you do not need to
specified data type of the input paramenter. DAAB 3.0 is class library that
database indepenedent:
http://ipattern.com/simpleblog/PermLink.aspx?entryid=24

Neither Data Adapter Wizard nor CommandBuilder classes support BLOB
parameters in them, so it is not possible to use them.

I also talk about factory pattern on my site search for Factory Pattern.
Maxim

[www.ipattern.com do you?]
 
Back
Top