Hi, I'm a french novice about oracle.
I work with the table EMP supplied with ORACLE.
I want to create a page JSP which print on the screen the table EMP. I use oracle.jsp.dbutil.BeanUtil . This bean offers a method which return HTML table from a Java Resulset (see for more information)
I deploy BeanUtil into Oracle DataBase.
I create a package which will be called by the Javaserver Page. This package returns the HTML table to the page JSP
The package:
CREATE OR REPLACE PACKAGE TOOLS_HTML
AS
TYPE MYTYPEOFCURSOR IS REF CURSOR RETURN EMP%ROWTYPE;
FUNCTION CALL_BEAN_UTIL (cur IN MYTYPEOFCURSOR)
RETURN VARCHAR2;
FUNCTION LISTE_EMPLOYE RETURN VARCHAR2
END TOOLS_HTML
;
CREATE OR REPLACE PACKAGE BODY TOOLS_HTML
AS
FUNCTION CALL_BEAN_UTIL (cur IN MYTYPEOFCURSOR)
RETURN VARCHAR2
AS LANGUAGE JAVA NAME 'oracle.jsp.dbutil.BeanUtil.translateToHTMLTable(java.
sql.ResultSet) return java.lang.String';
FUNCTION LISTE_EMPLOYE RETURN VARCHAR2 AS
machaine VARCHAR2(32000);
moncurseur MYTYPEOFCURSOR;
BEGIN
OPEN moncurseur FOR SELECT * FROM EMP;
machaine := TOOLS_HTML.CALL_BEAN_UTIL(moncurseur);
RETURN machaine;
END;
END;
The JSP:
[...]
cstmt = conn.prepareCall("begin ?:= TOOLS_HTML.LISTE_EMPLOYE(); end;"
cstmt.registerOutParameter(1,OracleTypes.VARCHAR);
cstmt.execute();
reponse = cstmt.getString(1);
System.out.println(reponse);
}
catch (SQLException e) {
%><%= e.getMessage()%><%}
Oracle compile the package with no error but when I execute with SQL*PLUS:
SQL> DECLARE
2 chaine varchar2(30000);
3 BEGIN
4 chaine:=TOOLS_HTML.LISTE_EMPLOYE();
5 END;
6 /
DECLARE
*
ERREUR à la ligne 1 :
ORA-00600: code erreur interne, arguments : [15419], [severe error during
PL/SQL execution], [], [], [], [], [], []
ORA-06544: PL/SQL : erreur interne, arguments : [pgm.cgmbiad2()], [102], [],
[], [], [], [], []
ORA-06553: PLS-801: erreur interne [0]
When I execute the JSP page, the server return the same error.
Could I help me please?
I work with the table EMP supplied with ORACLE.
I want to create a page JSP which print on the screen the table EMP. I use oracle.jsp.dbutil.BeanUtil . This bean offers a method which return HTML table from a Java Resulset (see for more information)
I deploy BeanUtil into Oracle DataBase.
I create a package which will be called by the Javaserver Page. This package returns the HTML table to the page JSP
The package:
CREATE OR REPLACE PACKAGE TOOLS_HTML
AS
TYPE MYTYPEOFCURSOR IS REF CURSOR RETURN EMP%ROWTYPE;
FUNCTION CALL_BEAN_UTIL (cur IN MYTYPEOFCURSOR)
RETURN VARCHAR2;
FUNCTION LISTE_EMPLOYE RETURN VARCHAR2
END TOOLS_HTML
;
CREATE OR REPLACE PACKAGE BODY TOOLS_HTML
AS
FUNCTION CALL_BEAN_UTIL (cur IN MYTYPEOFCURSOR)
RETURN VARCHAR2
AS LANGUAGE JAVA NAME 'oracle.jsp.dbutil.BeanUtil.translateToHTMLTable(java.
sql.ResultSet) return java.lang.String';
FUNCTION LISTE_EMPLOYE RETURN VARCHAR2 AS
machaine VARCHAR2(32000);
moncurseur MYTYPEOFCURSOR;
BEGIN
OPEN moncurseur FOR SELECT * FROM EMP;
machaine := TOOLS_HTML.CALL_BEAN_UTIL(moncurseur);
RETURN machaine;
END;
END;
The JSP:
[...]
cstmt = conn.prepareCall("begin ?:= TOOLS_HTML.LISTE_EMPLOYE(); end;"
cstmt.registerOutParameter(1,OracleTypes.VARCHAR);
cstmt.execute();
reponse = cstmt.getString(1);
System.out.println(reponse);
}
catch (SQLException e) {
%><%= e.getMessage()%><%}
Oracle compile the package with no error but when I execute with SQL*PLUS:
SQL> DECLARE
2 chaine varchar2(30000);
3 BEGIN
4 chaine:=TOOLS_HTML.LISTE_EMPLOYE();
5 END;
6 /
DECLARE
*
ERREUR à la ligne 1 :
ORA-00600: code erreur interne, arguments : [15419], [severe error during
PL/SQL execution], [], [], [], [], [], []
ORA-06544: PL/SQL : erreur interne, arguments : [pgm.cgmbiad2()], [102], [],
[], [], [], [], []
ORA-06553: PLS-801: erreur interne [0]
When I execute the JSP page, the server return the same error.
Could I help me please?