Download DB2

Write to be Read

July 14th, 2008 by Leons Petrazickis

In 1997, Jakob Nielsen wrote How Users Read on the Web. His organization conducted a formal study of usability and found:

  • Concise text (half the words) is 58% more readable than rambling text.
  • Scannable text (bullets) is 47% more readable than wall of text.
  • Neutral language (facts) is 27% more readable than marketese.

Nielsen added specific recommendations:

  • Mark keywords
  • Use descriptive headings (not puns or references)
  • Use bullets
  • Limit one paragraph to one idea
  • Start with the conclusion
  • Halve the wordcount

Concise text

Blaise Pascal: I have only made this letter long because I have not had the time to make it short.

Maintaining high information density is hard. You need to edit and cut the dead text. It takes up your time, but it saves readers time; it is respectful.

Scannable text

I think that Jakob Nielsen and Jeff Atwood overuse bolding. Nevertheless, they remain widely read because their postings are clear and readable. I can see at a glance their topics, their reasoning, and their conclusions.

Neutral Language

Being positive and writing empty boasts is different. Don’t blather about awesomeness, or people will ignore even the facts.

Inverted pyramid style

Observe:

  • Newspaper stories start with the most important fact and work down.
  • Essays start with the thesis and then prove it.
  • Reports start with an executive summary.

Posted in db2, writing | No Comments »

Why does that website suck?

July 14th, 2008 by Leons Petrazickis

I now run a website for work. And, well, why does it suck? Why is it insufficient, poor, awful, bad, ugly, and useless? I can’t fix it if I don’t know what’s wrong.

Website Screenshot

The three goals the website has is to:
- Drive downloads for DB2 Express-C
- Provide references and community support
- Encourage purchases of support

Does it do so? Is the download easy to find? Supporting information? Tutorials? Forums and blogs and newsgroups? Extra drivers?

Is everything that should be there, there? Is everything that shouldn’t be there, not there?

I’d really appreciate some feedback, no matter how minor.:-)

Posted in db2, ask | 2 Comments »

Error: Failed to build gem native extension.

June 30th, 2008 by Leons Petrazickis

I ran into a tiny pickle while installing the ibm_db gem on Ubuntu:

Select which gem to install for your platform (i486-linux)
 1. ibm_db 0.9.5 (ruby)
 2. ibm_db 0.9.5 (mswin32)
 3. ibm_db 0.9.4 (ruby)
 4. ibm_db 0.9.4 (mswin32)
 5. Skip this gem
 6. Cancel installation
> 1
Building native extensions.  This could take a while
ERRORWhile executing gem … (Gem::Installer::ExtensionBuildError)
    ERROR: Failed to build gem native extension.

ruby extconf.rb install ibm_db
extconf.rb:9:in `require’: no such file to load — mkmf (LoadError)
        from extconf.rb:9

The problem is that mkmf isn’t included in the base Ruby package on Ubuntu. You need need the full development package to install gems from source. Installing it solves the problem.

sudo apt-get install ruby1.8-dev
 

Posted in db2, ruby | 2 Comments »

Behold, the Web 2.0 Starter Toolkit for DB2!

August 9th, 2007 by Leons Petrazickis

The Starter Toolkit is an easy way to deploy a WAD-on-PHP stack – Windows Apache DB2 PHP. It includes some neat functionality for generating Atom feeds from XML data in your DB2 databases, and some excellent REST-ful web service wrappers from tables and stored procedures.

I’ve spent my last few months tinkering with it, so do take a look. There should be a few posts about it coming down the line, from both external and internal perspectives.
Install Apache, DB2, PHP, and lots of goodiesControl Panel MenuCreate Atom FeedsCreate REST-ful PHP web services
How is it different from Zend Core for IBM? Well, the toolkit has the Atom stuff, and the web services stuff, and a bunch of helpful resources to help folks get started making apps full of Web 2.0-ey goodness.

We’ll be pushing out a fresh revision in double-time, so give me some feedback, consarnit!:-)

Posted in javascript, php, db2 | 1 Comment »

Rails and DB2 data types

May 28th, 2007 by Leons Petrazickis

When creating a table in a Rails migration, you have to specify data types using platform-agnostic names. The mapping of Rails types onto DB2 types is defined in ibm_db_adapter.rb:

:primary_key => @servertype.primary_key,
:string      => { :name => "varchar", :limit => 255 },
:text        => { :name => "clob" },
:integer     => { :name => "integer" },
:float       => { :name => "float" },
:datetime    => { :name => "timestamp" },
:timestamp   => { :name => "timestamp" },
:time        => { :name => "time" },
:date        => { :name => "date" },
:binary      => { :name => "blob" },

# A boolean can be represented  by a smallint,
# adopting the convention that False is 0 and True is 1
:boolean     => { :name => "smallint"},
:xml         => { :name => "xml"},
:decimal     => { :name => "decimal" }
 

Useful Resources

InfoCenter | DB2 Data Types
dW | DB2 and Ruby on Rails, Part 1 (May 2007)
dW | An Introduction to Ruby on Rails for DB2 Developers (June 2006)

The DB2 adapter is now called ibm_db. You can refresh your installation by typing gem install ibm_db at the command line and choosing the latest win32 release.

Posted in db2, ruby | No Comments »

The Importance of Separating Separators

February 28th, 2007 by Leons Petrazickis

I ran into a problem running a simple test xquery. I hadn’t directly dealt with XML namespaces in xquery prior to this, but the documentation was clear enough:

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x

Oops, EOF error. It needs a terminator.

XQUERY
declare default element namespace "http://posample.org"
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x;

Unexpected “for” following the namespace declaration? Pardon? It turns out xquery prologs need to be terminated by a semicolon:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn(”PURCHASEORDER.PORDER”)
return $x;

Unexpected “http://posample.org”? But that’s the exact syntax given in the examples! Alas, this semicolon is distinct from the usual semicolon separator in SQL. It’s part of a single xquery statement, so what I need to do is change the SQL separator to something more exotic. This will allow xquery to be parsed correctly:

XQUERY
declare default element namespace "http://posample.org";
for $x in db2-fn:xmlcolumn("PURCHASEORDER.PORDER")
return $x@

Eureka.:)

Posted in db2 | 1 Comment »

A major error occurred while installing

February 20th, 2007 by Leons Petrazickis

Swapping Zend Core and the beta of Zend Core 2 around, I got my computer to a state where DB2 would not run, would not uninstall, and would not reinstall. Zend had hosed my DLLs/registry/environment in some unknown way.

Digging around turned up that, for times when the graphical uninstaller fails, there is a command line one that always works:
db2unins - Uninstall DB2 database product command

I’m not entirely clear on why they didn’t just fix the graphical uninstaller instead of writing a second one. Still, db2unins -f cleaned my system, allowing me to reinstall DB2 and remap existing databases.

Posted in db2 | No Comments »

Mapping existing databases after reinstalling DB2

February 12th, 2007 by Leons Petrazickis

Due to the vagaries of software, I had to reinstall DB2 on my laptop. Unfortunately, the existing databases were not automatically added to the Control Center.

Physically, DB2 stores its databases in a directory similar to C:\DB2\NODE0000. Logically, there must a way to remap them. So, how does one remap them?

To list databases stored at a path:
% db2 list db directory on c:

To recatalog them:
% db2 catalog db SAMPLE on c:

Reference:
DB2 at a Glance | The DB2 Environment

Posted in db2 | 1 Comment »