|
From: Thomas R. <tri...@tr...> - 2003-02-24 20:17:05
|
Hi guys,
I have just joined the group and I'm really looking forward to working
on this framework. Great stuff so far. I have e-mailed Rod with a few
suggestions for the SQLExceptionTranslater functionality, we should be
able to add some of the new features to CVS real soon.
While testing the changes to the SQLTranslation logic on different
databases I ran across a problem with using the StoredProcedure class
from the jdbc.object package.
It currently only supports the "{call my_proc(?, ?)}" syntax and this
worked fine for procedures but not for stored functions. With functions
you have to use the following call syntax "{? = call my_func(?)}". Since
all stored procedures in Postgres are declared as functions (CREATE
FUNCTION ...) it was a problem.
I came up with two solutions, and would like to know which one you would
prefer.
1. Add a boolean instance variable isFunction = false to the
StoredProcedure. This could be set to true if the call is to a function
or left false if it is to a procedure. Then the StoredProcedure could
use the correct syntax while it is "compiling" the callString
2. Create a StoredFunction class that does the same thing the current
StoredProcedure does, except for the call syntax. We could use
sub-classing to avoid code duplication
The first solution is simpler and less code, but maybe not as clear as
the second one.
This would be a good feature not only for Postgres, but for any database
that supports the CREATE FUNCTION feature - Oracle, MS SQL, DB2 ...
Let me know what you think.
Also - is anybody working on any other parts of the jdbc package? I'd
be interested to look at other issues, but I don't want to solve/fix
something that someone else is already looking at.
-- Thomas
|