Platinum Solutions Corporate Website


Databases

Hibernate, null pointers, and the no-argument constructor

There are two occasions when hibernate will ‘hydrate’ an object as null. Suppose you are tracking data about people, storing name, address and demographic information. Your classes might look like this:
public class Person {
private Name name;
private List demographics;

… other items …

public Person() {}
//no-argument constructor required by Hibernate.

… setters and getters …

}

public class Name{
private String firstName;
private String lastName;
--- other items ---
}

Quality Open Source Database Tools

Here are some open source database tools that caught my eye. I haven't had much of a chance to try them out, but I'm glad they exist, and I hope one day I get the chance to use them...

Talend
http://www.talend.com/index.php

One-to-One

How do I Justify a one-to-one relationship:

A database developer asked me a couple weeks ago to justify the use of one-to-one relationships within his design document. He stated that the only thing he found on the web concerning one-to-one relationships was ‘Use them when appropriate for your situation’. Now if that is not helpful, I do not know what is. But the web does provide a lot of that advise.

One-to-one relationship: Defined as the existence of exactly one record in Table A that corresponds to one record in Table B.

Database auditing

I recently read a white paper put out by Sybase that tries to answer the age-old question (or at least help define the question) of how to ensure that the people you trust the most with your corporate data are NOT the ones who are ripping you off. The target audience is the commercial IT manager or CIO. The paper talks a lot about Sarbanes-Oxley, as you might imagine.

A Case of Blob Indigestion

On a recent project I had to persist image features into a database to be used on a content-based image retrieval (CBIR) system. These features included the following:

  • Color - represented as histograms for each color band; each histogram consisted of 256 float numbers.
  • Shape - represented as 127 Fourier coefficients (complex numbers).
  • Texture - represented as an array of the top 60 peaks locations (and sign) on a 128x128 wavelet decomposition grid; the wavelet decomposition is performed in each of the three color bands.

I normally do my modeling in terms of object orientation first. I created an ImageFeatures class which had references to other classes such as Color, Shape and Texture. Each of these classes ended up holding a primitive array of float numbers for the corresponding feature data. That's all well and good. Pretty simple stuff.

DB2 (Viper) Relational / XML Database

A recent issue of Infoworld magazine had a cover article on Viper, IBM's new release of DB2 (version 9.1). The major enhancement is that it stores XML data in native format, not as a CLOB or BLOB. Here's a link to the article:

http://www.infoworld.com/article/06/08/14/33FEdb2viper_1.html?s=feature

Quoting one paragraph:
For starters, it gives you the ability to access
XML data using SQL queries, just like ordinary relational tables. You
can also use XQuery to access relational tables, in addition to XML.
You can even use relational SQL to limit the range of data pulled back
from XQuery expressions. DB2 allows almost continuous intermixing of
the two languages.

Oracle 10g Express Edition

Just a quick post to make sure all know that a version of Oracle's 10g database is now free...

Free
to develop, deploy, and distribute

Oracle Database 10g Express Edition (Oracle Database XE) is an entry-level, small-footprint database based on the Oracle Database 10g
Release 2 code base that's free
to develop, deploy, and distribute; fast to download; and simple to
administer.

 Oracle 10g Express Edition has the expected limitations on size, but Oracle has greatly improved the install process.  (If you have tried to install 9i before... you'll see what I mean.)  They appear to be going after the MySQL market share with this free offering...  should be interesting to see how it plays out for them.

For your next project, it will be worth your time to investigate this new option.

 

SchemaSpy - Get to know any schema quicker than ever.

Are you new to a database schema and want to get to know it quickly?  It is very common for a system in development to interact with an existing system and all too often, the requirements for this interaction are vague and difficult to understand, and gaining knowledge about this (potentially very old) system can be even harder.

Of course, there are tons of ways to learn about a schema.  Old school DBA’s may prefer to do manual queries on the views of the database metadata (all_tables, user_tables, all_objects, etc) to get an idea of how it works.  People not as familiar with such ‘DBA-esque’ things may have a hard time extracting an understanding of the data model using nothing but queries.  Often times, it might be easier to get an understanding using such tools as Toad and SQuirreL.  I just recently found a tool called SchemaSpy that can answer a LOT of questions that a ‘newbie’ may have about a schema.

Microsoft Excel for Database Administration. Buried Treasure from Redmond – PART 1

When most people think of Microsoft Excel, they think of graphs, formulas, financials, etc.  But by scratching slightly below the surface, one will notice that Excel is extremely powerful at more than just the everyday crunching and presentation of data.

In working with databases on a regular basis, there are tedious tasks that can take valuable time away from expanding, solidifying and tuning the database itself.  Of course there are 3rd party tools that can be used for database administration.  However, for data related issues that require large numbers of SQL statements to insert or update records, or to perform in-depth analysis of large amounts of data, I find that there is no better tool than Microsoft Excel.

An Iterative approach to Data Migration

An Iterative Approach to Data Migration

Data Migration is the process of moving required (and most often very large) volumes of data from existing systems to new systems. I found that such projects can benefit from the use of a tailored development process. This process I came up with can be broken down into three phases.

 

      Requirements and Design Phase (Mostly requirements gathering activities)