dbTalk Databases Forums  

import java on cli

comp.databases.oracle.tools comp.databases.oracle.tools


Discuss import java on cli in the comp.databases.oracle.tools forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Thomas Peter
 
Posts: n/a

Default import java on cli - 03-20-2007 , 05:00 AM






hi,
i wrote java code using pl/sql developer.
now i need to deploy it to some other instances and would like to do it
on the commandline.
is there a way to do so?
i found loadjava, but then i need to compile the code on my client, not
in oracle.
is there a way to let oracle load the source and compile it itself?
thnx
thomas


Reply With Quote
  #2  
Old   
frank.van.bortel@gmail.com
 
Posts: n/a

Default Re: import java on cli - 03-21-2007 , 06:01 AM






On 20 mrt, 12:00, Thomas Peter <braindum... (AT) expires-31-03-2007 (DOT) news-
group.org> wrote:
Quote:
hi,
i wrote java code using pl/sql developer.
now i need to deploy it to some other instances and would like to do it
on the commandline.
is there a way to do so?
i found loadjava, but then i need to compile the code on my client, not
in oracle.
is there a way to let oracle load the source and compile it itself?
thnx
thomas
Not exactly sure of the problem you have,
but you can do this from a SQL session:

create or replace and compile java source named "your_code" as
import ....;
public class {...
}

Call it, using a wrapper like a procedure:

create or replace procedure my_proc( p_in_param in varchar2 )
as language java
name 'your_code';
/



Reply With Quote
  #3  
Old   
Thomas Peter
 
Posts: n/a

Default Re: import java on cli - 03-21-2007 , 08:06 AM



frank.van.bortel (AT) gmail (DOT) com wrote:
Quote:
Not exactly sure of the problem you have,
but you can do this from a SQL session:

create or replace and compile java source named "your_code" as
import ....;
public class {...
}
yes, i did this using a gui. worked fine. i call it using a function,
works fine as well.

but how do i deploy this code to another db-instance via script.
i can't do a @scriptname in sqlplus (i receive an error about invalid
characters)
an when i use loadjava i have to compile the code before i load it,
which i don't want neither.

so is there a way to get the java-(source)code from a commandline
(without a gui) in the database.
(calling the code is no prob, since i can call functions or procedures
that call the java from sqlplus)

thnx,
thomas



Reply With Quote
  #4  
Old   
frank.van.bortel@gmail.com
 
Posts: n/a

Default Re: import java on cli - 03-21-2007 , 08:46 AM



On 21 mrt, 15:06, Thomas Peter <braindum... (AT) expires-31-03-2007 (DOT) news-
group.org> wrote:
Quote:
frank.van.bor... (AT) gmail (DOT) com wrote:
Not exactly sure of the problem you have,
but you can do this from a SQL session:
create or replace and compile java source named "your_code" as
import ....;
public class {...
}

yes, i did this using a gui. worked fine. i call it using a function,
works fine as well.

but how do i deploy this code to another db-instance via script.
i can't do a @scriptname in sqlplus (i receive an error about invalid
characters)
an when i use loadjava i have to compile the code before i load it,
which i don't want neither.

so is there a way to get the java-(source)code from a commandline
(without a gui) in the database.
(calling the code is no prob, since i can call functions or procedures
that call the java from sqlplus)

thnx,
thomas
Your GUI tool must use some special characters - it should run
from a command line (aka script) as well - I do it that way.
Maybe a simple (notepad?) tool will show the offending characters?

Post the command, and the exact error from the sqlplus session.



Reply With Quote
  #5  
Old   
Thomas Peter
 
Posts: n/a

Default Re: import java on cli - 03-22-2007 , 06:43 AM



frank.van.bortel (AT) gmail (DOT) com wrote:
Quote:
Your GUI tool must use some special characters - it should run
no it doesn't. i have an & in my java-code and this is the problem.

is there a way to escape this?



Reply With Quote
  #6  
Old   
Thomas Peter
 
Posts: n/a

Default Re: import java on cli - 03-22-2007 , 06:55 AM



Thomas Peter wrote:

Quote:
frank.van.bortel (AT) gmail (DOT) com wrote:
Your GUI tool must use some special characters - it should run

no it doesn't. i have an & in my java-code and this is the problem.

is there a way to escape this?
set define off

solves the problem!

sorry for the noise



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.