From: Stephen Crawley <crawley@dstc.edu.au>
To: Ricardo Maia <rjmaia@student.dei.uc.pt>
Cc: pgsql-interfaces@postgresql.org
Cc: crawley@dstc.edu.au
Subject: Re: Using BLOBs with several DBMS
Date: Fri, 08 Jun 2001 15:30:26 +1000
Message-ID: <200106080530.f585UO601918@piglet.dstc.edu.au> (raw)
In-Reply-To: <rjmaia@student.dei.uc.pt> <01052915045203.13393@valkyrie>
> My question is: how can i create a table with one BLOB field, in a DBMS
> independent way?
>
> I am using PostgreSQL7.1 and Oracle 8 but I want to make it be able to work
> with other DBMSs.
It is difficult, because:
* Different versions of SQL use different names for the BLOB type.
* Some DBMS don't support blobs at all.
* Some DBMS treat blobs differently to other SQL types and
require you to use special APIs to access them.
* Not all JDBC drivers support the JDBC 2.0 Blob APIs. Of those
that do, many implement them in part only.
Given this mess, you've got two choices:
* Define a Java interface for all of your database interactions.
Create a different implementation for each DBMS you plan to support,
complete with embedded SQL statements, table schemas, etc.
* Define wrapper classes for JDBC, and try to isolate the DBMS
differences in "adapters". This (more or less) allows you to
share SQL statements / table schemas across DBMS, but it is
kind of hard getting the wrapper / adapter APIs right.
-- Steve
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: crawley@dstc.edu.au, rjmaia@student.dei.uc.pt
Subject: Re: Using BLOBs with several DBMS
In-Reply-To: <200106080530.f585UO601918@piglet.dstc.edu.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox