|
From: <tri...@tr...> - 2003-08-08 20:32:26
|
Juergen, Rod & All,
I have put up a notice about the new release on the web site.
> I'm just about to commit some changes to AOP in the old com.interface21
> tree, but I suggest we do the package switch early next week.
>
I also have some changes to that did not make 0.9.1. I just checked in a change
to the StoredProcedure/SqlParameter. It now supports returning a Types.ARRAY
from a stored procedure based on a type name -- only tested with Oracle so far.
This is all standard JDBC functionality - nothing Oracle specific.
Let's all coordinate before we cut over to a new CVS module so we don't have to
reapply changes that missed the cutover.
Thomas
P.S.
You could use thes new feature like this:
CREATE TYPE t_array IS TABLE OF VARCHAR2(1000);
CREATE FUNCTION get_array RETURN t_array
IS
v_values t_array;
BEGIN
SELECT col1 BULK COLLECT INTO v_values
FROM table1;
RETURN v_values;
EXCEPTION
WHEN NO_DATA_FOUND THEN
RETURN NULL;
END;
private class MyCall extends StoredProcedure {
public MyCall(DataSource ds) {
super(ds, "get_array");
setFunction(true);
declareParameter(new OutputParameter("array", Types.ARRAY, "T_ARRAY"));
compile();
}
public String[] execute() {
Map in = new HashMap();
Map out = execute(in);
java.sql.Array retValue = (java.sql.Array) out.get("array");
String[] retStringArray = null;
try {
retStringArray = (String[]) retValue.getArray();
}
catch (SQLException se) {
throw new TypeMismatchDataAccessException("Failed to get array", se);
}
return retStringArray;
}
}
|