Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3212

JAVA Function Error

$
0
0

I get the following error when I run JAVA function:

 

=============================================

The following error occurred while fetching results:

Procedure 'hello' terminated with unhandled exception

'java.lang.Security Exception: File I/O not allowed'

SQLCODE=-91, ODBC 3 State='HY000"

=============================================

 

[OS Environment]

*  Linux testsvr 2.6.9-89.EL #1 Mon Apr 20 10:22:29 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

*  Java -version : java version "1.4.2_11"

*  Sybase Server Version : 12.7.0/ESD 12

 

[Java Source Code]

import java.io.FileInputStream;

 

public class Dummy {

        public static String hello(String str) throws Exception {

               FileInputStream fis = null;

               try {

                       fis = new FileInputStream("/app/sybase/Test/test.txt");

                       fis.read();

                       return str;

               } catch (Exception e) {

                       throw e;

               } finally {

                       if (fis != null) {

                              try {

                                      fis.close();

                              } catch (Exception e) {}

                       }

               }

        }

}

Function SQL

 

 

[SQL Statements]

Install java new from file '/app/sybase/Test/Dummy.class';

Create function testdummy(in name varchar(249)) returns varchar(255) external name 'Dummy.hello(Ljava/lang/String;)Ljava/lang/String;' language JAVA;

Select testdummy('abc');

 

 

Permission was granted permission from the top 777.

 

Any help would be really appreciated.

 

Thank you.


Viewing all articles
Browse latest Browse all 3212

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>