Platinum Solutions Corporate Website


SQL

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.

XQuery: Successor to SQL?

XQuery is a technology that being defined by the W3C (World Wide Web Consortium) which provides a flexible and standardized way of querying collections of relational, XML or object data.  Built on XPath expressions, the language allows developers to effectively address specific parts of documents that are structured in XML's hierarchical unified format for data-centric information.  Currently XQuery is supported by all the major database engines (IBM, Oracle, Microsoft, etc.) as well as application server vendors such as BEA and Software AG.

Essentially XQuery is to XML data sources what SQL (Standard Query Language) is to relational tables.  In situations where all you need to do query relational databases, then SQL is all you need.  But if you need to query XML and/or a combination of XML and relational sources, SQL will not be enough; you'll need something with the ability to query nearly any kind of content: XML documents, relational stores, PDF files, or Microsoft Office documents.  XQuery provides that ability and much more.

IBatis – You already know how to use it.

I have always been a fan of simple technologies.  Technologies that maximize productivity and flexibility.  iBatis is a persistence framework that falls into this category.  The best part about Ibatis is that you already know how to use it.  No OQL, HQL, XQL, just SQL and Java.

http://www.developer.com/java/data/article.php/3346301

Still too hard you say?  Then use Abator.  It generates objects and READABLE configuration files, DAO, SQL and value objects from the database schema.

A better way of working with Oracle

Oracle has now been the dominant database for quite some time now. It is indeed a powerful database, with a plethora of high end features. Why is it then that the primary interface for the database administrator is a poor command line tool, which has remained essentially unchanged for more than 10 years?

Yes, I'm talking about good old SQL*Plus. Despite being used by a generation of DB administrators, it lacks simple functionality which would greatly ease the administrator’s life.
In particular:

•    Line editing capabilities. I can't tell you how many times I've typed a long SQL statement just to realize that I had typed "selct" way back at the beginning.  Sqlplus does have (weak) sed-like editing capabilities, and the ability to edit the previously run command in your choice of editor, but that's only AFTER you've executed your faulty command.  From what I've seen, "backspace" seems to be the editing method of choice.
•    History. Sqlplus only stores the last command you have run. But when I'm looking around in several tables, I need to go back and recover previous commands. Almost invariably, I end up opening another window just so I can copy the commands that I need to run repeatedly.
•    Table/Field name completion. Every modern IDE has the useful feature of allowing code completion -- you type part of a command, and the IDE can suggest what you want to enter.