Re: create java class using bfile
Date: 30 Aug 2001 10:43:41 -0700
Message-ID: <cea38d69.0108300943.35911ff2_at_posting.google.com>
Allen, thank you for the quick response.
I tried
CONNECT System/Manager
GRANT CREATE ANY DIRECTORY TO Scott IDENTIFIED BY Tiger;
CONNECT Scott/Tiger
CREATE DIRECTORY Bfile_dir AS 'C:\My_test\db\JSP';
CREATE JAVA CLASS USING BFILE (Bfile_dir, 'GetStudentInfo.class');
but got
Connected.
Grant succeeded.
Connected.
CREATE DIRECTORY Bfile_dir AS 'C:\My_test\db\JSP'
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
CREATE JAVA CLASS USING BFILE (Bfile_dir, 'GetStudentInfo.class');
*
ERROR at line 1:
ORA-29510: name, SCOTT.GetStudentInfo, already used by an existing object
I also tried to use loadjava to load the class. When I used
loadjava -u system/manager_at_coo -f -resolve GetStudentInfo.class
it run with no error.
But I got
SELECT get_student('China') FROM STUDENT
*
ERROR at line 1:
ORA-29531: no method getStudentByCountry in class GetStudentInfo
That is why I tried to use CREATE JAVA CLASS USING BFILE instead of loadjava...
Any suggestion?
Thanks
Mark
allanwtham_at_yahoo.com (godmann) wrote in message news:<95cd51c.0108292125.3c3a592d_at_posting.google.com>...
> Mark,
>
>
> See the excerpts below
> -------------------------------
>
> To create the directory object, you must grant user scott the CREATE
> ANY DIRECTORY privilege, then execute the CREATE DIRECTORY statement,
> as follows:
>
> CONNECT System/Manager
> GRANT CREATE ANY DIRECTORY TO Scott IDENTIFIED BY Tiger;
> CONNECT Scott/Tiger
> CREATE DIRECTORY Bfile_dir AS '/home/java/bin';
>
>
> Now, you are ready to create the class libunit, as follows:
>
> CREATE JAVA CLASS USING BFILE (Bfile_dir, 'Agent.class');
>
>
> The name of the libunit is derived from the name of the class.
>
> Alternatively, you can use the command-line utility LoadJava. This
> uploads Java binaries and resources into a system-generated database
> table, then uses the CREATE JAVA statement to load the Java files into
> RDBMS libunits. You can upload Java files from file systems, Java
> IDEs, intranets, or the Internet.
>
> -----------------------
>
> To use loadJava, there is a metalink article on it. Note:114009.1
>
> Allan W. Tham
> DBA
Received on Thu Aug 30 2001 - 19:43:41 CEST