Menu

#2 DB2 driver enhancements

open
nobody
None
5
2002-08-05
2002-08-05
No

!!! NOTE !!!: this patch requires extensions to ruby/db2 driver to
function correctly!

The existing DB2 driver was extended to fix these problems:

1) BLOB/CLOB functionality
I needed to marshal large objects into a DB2 database and the
'VARCHAR' solution wasn't good enough (4kb page limit). Creating
the database in a 32kb tablespace doesn't solve the problem, it just
postpones it for a later time (like, say, the Y2K problem??! :-) So, I
added Large Object functionality using parameter binding (read on...)

2) Better parameter binding
Looking inside the DB2 driver, I saw that parameter binding was
actually implemented with string substitutions, so I rewrote the driver
in order to achieve (hopefully) two goals:
a) ability to use BLOB/CLOB datatype (see 1)
b) ability to call stored procedures with result parameters
b) make better use of server resources (e.g. prepared statements)
since the backend wouldn't have to parse raw strings in order to
process field values.

3) Better error reporting
When the shit hits the fan, I want to know as a programmer a)
where does the shit comes from?, b) what color does it have?, c)
how does it smell? (remember Bertolucci's 'The Last Emperor'? :-) In
essence, I needed all the data I could get, so I used SQLGetDiagRec
to fulfil my shitty needs :-)

Discussion

  • Elias Karakoulakis

     
  • Elias Karakoulakis

    Patch to version 0.2 of Ruby/DB2 driver by Michael Neumann

     
  • Elias Karakoulakis

    write multiple BLOBs example

     
  • Elias Karakoulakis

    Read back BLOB into files

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.