java stored


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';
/

Wyszukiwarka

Podobne podstrony:
java text FieldPosition
java
java text CollationElementIterator
java io InvalidClassException
tworzenie aplikacji w jezyku java na platforme android
Java Tęczowy tekst
java awt image IndexColorModel
java awt image ImageConsumer
java beans PropertyChangeEvent
java awt event ActionEvent
java awt event FocusEvent
java rmi server RMISocketFactory
Java

więcej podobnych podstron