From: l.paige at live.com (Larry) Date: Tue, 6 Sep 2011 20:37:24 -0700 (PDT) Subject: [Pljava-dev] PlJava Function-Mapping Message-ID: <1315366644852-4777098.post@n5.nabble.com> I seem to having problems writing a PLJava function-mapping. Consider the code examples shown below that demonstrates in a very simple manner the problem I am having: *Consider I define the following PL Java function in PostgreSQL:* CREATE OR REPLACE FUNCTION stringtest(character varying) RETURNS tuple AS 'test.Org.getString' LANGUAGE java VOLATILE SELECT * FROM teststring(?hello?); *The in Java I have:* public class Org { public static boolean getString(String input, ResultSet receiver) throws SQLException{ String input_ = Common.getParam2(); receiver.updateString("first", input); receiver.updateString("second", input_); return true; } } public class Common { public static String getParam2(){ try { Class.forName("org.postgresql.Driver"); Connection connection = DriverManager.getConnection( "jdbc:postgresql://localhost:5432/mydb", ?username", ?password"); ResultSet rs = connection.createStatement().executeQuery( "select id FROM events" ); if(rs.next()) return rs.getString("id"); } catch (Exception ex) { ex.printStackTrace(); } return null; } } So now the problem is: if I don?t call /Common.param2()/ and instead just hard-code some dummy-string everything works fine. But when I try calling some other function, such as /.getParam2()/, I get an error, as follows: / ERROR: java.lang.NoClassDefFoundError: Could not initialize class java.net.InetAddress/ Clearly the above is just the standard SDK, so this is really confusing me as to why it is happening. Any help would be much appreciated. -- View this message in context: http://postgresql.1045698.n5.nabble.com/PlJava-Function-Mapping-tp4777098p4777098.html Sent from the PL/Java mailing list archive at Nabble.com.