JUDF "Java Subsystem Error" While Trying to Read a Properties File

General
Teradata Employee

JUDF "Java Subsystem Error" While Trying to Read a Properties File

Hi,

 

I have written a JUDF which does name matching between two input strings. This also involves a lookup to a NickName Table to find a potential match. The result of the UDF is either 1 (match) or 0 (non match). 

I have externalized the DB names and the SQL for checking against the nickname table in a properties file as I didnt want to change the DB details and compile for every environment. My properties file (which has DB login details and SQL) resides at the same location as the .class files in the jar. Also tried putting it in the lib folder. However, when I try to execute this UDF,  it doesnt seem to pick up this file and gives a "Java Subsystem Error (Error 9 encountered at line -2)". The same jar works perfectly when executed from the console. Would anyone know why it cannot read this file packaged in the jar once deployed to the DB and what the path needs to be?

Code Snippet:

public class MatchFirstName {

// Loading resource data from property
private static Properties prop;
static {
InputStream is = null;
try {
prop = new Properties();
is = ClassLoader.class.getResourceAsStream("databaseutil.properties");
prop.load(is);
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}

databaseutil.properties

CONNECTION_URL=jdbc:teradata://*****/TMODE=TERA
DB_USER=****
DB_PWD=****
NICK_NAME_FETCH_SQL=LOCKING ROW FOR ACCESS SELECT NK_NM FROM MST_NCKNM_LKP WHERE FST_NM=?

****

 

Thanks in advance.

SG.