I'm trying to call my function "NUMBERINGMACHINE" by query (SQL> select numberingmachine("param1","param2")from dual;) that contain:
create or replace function NumberingMachine(numType in varchar2, now in varchar2) return varchar2 is language java name 'NumberingMachine.getSequence(java.lang.String, java.lang.String) return java.lang.String';
and then the function will calling the java class (NumberingMachine class)
public class NumberingMachine {
public static String getSequence(String type, String now) throws SQLException {
/* Connect to database */
Connection conn = new OracleDriver().defaultConnection();
conn.setAutoCommit(false);
/* construct dynamic sql */
String selectSql = "SELECT NUMVALUE,NUMLEN,UPDTYPE,UPDDATE FROM M_SEQUENCE WHERE NUMTPCD = ? FOR UPDATE";
String updateSql = "UPDATE M_SEQUENCE SET NUMVALUE=?, UPDDATE=? WHERE NUMTPCD = ?";
but i get error: no more data to read from socket .
does anyone have the solution?
my oracle sql developer version:
SELECT * FROM V$VERSION
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production "CORE 11.2.0.1.0 Production"
TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production