Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: java stored procedures fast, but slow when called as SQL function
On 2003-04-09 13:47, pete_at_mynix.org <pete_at_mynix.org> wrote:
> Galen Boyer <galenboyer_at_hotpop.com> writes:
>
>> On 08 Apr 2003, pete_at_mynix.org wrote: >> >> > The only problem, as I think I have measured, is the binding between >> > the SQL engine and PL/SQL. >> >> But Java's datatypes are java's datatypes. What you are saying is that >> Oracle should rewrite the internals of its storage structure so there >> won't be any need for a conversion to java's datatypes. It can tightly >> couple PL/SQL with SQL cause they are both Oracle's.
Right. But those that do exist in both are most likely identical.
> 2. SQL's datatypes such as number(5,3), varchar2(20), nested tables
> etc have generic Java mappings, which are not as good a match as
> PL/SQL's. However, Oracls JDBC drivers already provide alternative
> mappings to own types; in package oracle.sql.* we have types such
> as STRUCT, REF, BLOB, NUMBER etc.
>
> Since Oracle claims it wrote the JDK basic classes (I assume this
> should include the Oracle specific JDBC classes/types as well) in
> native code, I do not see why they should not be able to get the same
> level of coupling between Java and SQL.
They might even be able to get these datatypes as fast as they are in PL/SQL, but
so the conversion problem still exists. PL/SQL strings can be in all kinds of encodings, a Java String is always UCS-2, so whenever a PL/SQL passes a string to Java or vice versa it has to be converted. I don't know if that is your problem, but I find it plausible that string conversion can be noticable on a java function which does nothing but return a duplicate of its string argument.
hp
-- _ | Peter J. Holzer | Latein ist das humanoide Äquivalent |_|_) | Sysadmin WSR | zu Fortran. | | | hjp_at_hjp.at | __/ | http://www.hjp.at/ | -- Alexander Bartolich in at.linuxReceived on Sun Apr 13 2003 - 16:09:35 CDT
![]() |
![]() |