create and compile java source named Tester as public class Tester{ public static String show(){ return "To naprawdę działa!"; } }; create or replace and compile java source named Drawer as import java.sql.*; public class Drawer{ public static String pobierz() throws SQLException{ String dane; #sql{select login into :dane from users where userid= '0'}; return dane; } }; create or replace and compile java source named Drawer as import java.sql.*; import oracle.jdbc.driver.*; public class Drawer{ public static java.sql.ResultSet pobierz() throws SQLException{ Connection conn = null; conn = new OracleDriver().defaultConnection(); ((OracleConnection)conn).setCreateStatementAsRefCursor(true); Statement stmt = conn.createStatement(); ResultSet rset = stmt.executeQuery("select login from users"); return rset; } }; / run script!!! CREATE OR REPLACE FUNCTION pobierz RETURN VARCHAR2 IS LANGUAGE JAVA NAME 'Drawer.pobierz() return String'; / CREATE OR REPLACE FUNCTION pobierz RETURN refcurpkg.tresult IS LANGUAGE JAVA NAME 'Drawer.pobierz() return ResultSet'; /