Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Oracle] "CREATE JAVA SOURCE" via ODBC?
Did you create a wrapper for you Java Source? If so, then ODBC doesn't have to see this Java Source, as it runs entirely in the database. Your application just interacts with the PL/SQL wrapper. For instance, I had a Java Source pkg called "OS_Util" in my database. I then wrote the following PL/SQL routine to access it:
CREATE OR REPLACE FUNCTION df (arg IN VARCHAR2)
RETURN NUMBER
AS
LANGUAGE JAVA
NAME 'OS_Util.df(java.lang.String[]) return int';
/
HTH,
Brian
Wojciech Maruszek wrote:
>
> Hello,
>
> I have an Oracle 9 database with ODBC drivers.
> I want to create a Java stored procedure.
> I have written the following statement:
>
> CREATE JAVA SOURCE NAMED SimpleClass AS
> public class SimpleClass
> {
> public static int is_positive(int number) {
> return (number >= 0) ? 1 : 0;
> }
> }
>
> The problem is that curly braces {} and question mark ?
> have special meaning for ODBC. My statement executes correctly
> when I switch to other drivers (like OCI). To make it work
> properly under ODBC, I have to modify Java source
> (e.g. replace ? : clauses with if's).
>
> Unfortunately, I have to stay with ODBC drivers.
> How to solve the problem?
-- =================================================================== Brian Peasland dba_at_remove_spam.peasland.com Remove the "remove_spam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three"Received on Mon Sep 29 2003 - 10:27:41 CDT
![]() |
![]() |