creating and writing a filein a java procedure which is activated when trigger fired. [message #90888] |
Sun, 18 November 2001 18:06 |
samba
Messages: 1 Registered: November 2001
|
Junior Member |
|
|
Hi,
i wrote java class and i load it into oracle8i
database . Steps i followed are:
1) Created the Java class containing the public static
method.
2) uploaded that into the database using loadjava
utility.
3) Create one procedure which will call that static
method
4) Created the trigger with calling the procedure
created in step3.
my java class is like this
----------------------------
import java.io.*;
public class data
{
public static void writeFile() throws SQLException
{
FileWriter fout = new FileWriter("file.txt");
fout.write("some data");
fout.close();
}
}
But when the trigger fired I got one error :
-------------------------------------------
java.security.AccessControlException: the Permission
(java.io.FilePermission
file.txt write) has not been granted by
dbms_java.grant_permission to
SchemaProtectionDomain(SAMBA|PolicyTableProxy(SAMBA))
ORA-04088: error during execution of trigger
'SAMBA.sample_tri'
Then I called :
call
dbms_java.grant_permission('SAMBA','java.io.FilePermission','test.txt','writ
e');
commit;
Again when trigger fired file is not created.
IT is giving that permission denied.
what i can do, please help me.
samba.
----------------------------------------------------------------------
|
|
|
|