Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Probs Using Java UDF'es......

0 views
Skip to first unread message

Adam Flinton

unread,
Mar 14, 1999, 3:00:00 AM3/14/99
to
Dear All,

I am trying to use a UDF from the Java Samples (the counter sample). I have
tried just about everything but no luck. When I set the Java Path
(JDK11_PATH) should it point to the
classes.zip?

As far as I can see Db2 is simply not finding the DB2Udf class file.....

I have included the dbm cfg just in case anyone can see what's wrong.

TIA

Adam

--------------------------- Command entered ----------------------------
CREATE FUNCTION NULLID.COUNTER() RETURNS INT EXTERNAL NAME
'DB2Udf!ctr' LANGUAGE JAVA PARAMETER STYLE DB2GENERAL NO SQL NOT
DETERMINISTIC NOT FENCED SCRATCHPAD
;

------------------------------------------------------------------------
DB21034E The command was processed as an SQL statement because it was not a
valid Command Line Processor command. During SQL processing it returned:
SQL0491N The CREATE statement for user defined function "NULLID.COUNTER"
must
have a RETURNS clause, and either the EXTERNAL clause (with other required
keywords) or the SOURCE clause. SQLSTATE=42601

--------------------------- Command entered ----------------------------
GET DBM CFG
------------------------------------------------------------------------

Database Manager Configuration

Node type = Database Server with local and remote clients

Database manager configuration release level = 0x0800

Maximum total of files open (MAXTOTFILOP) = 16000
CPU speed (millisec/instruction) (CPUSPEED) = 6.982823e-006

Max number of concurrently active databases (NUMDB) = 8
Transaction processor monitor name (TP_MON_NAME) =

Default charge-back account (DFT_ACCOUNT_STR) =

Java Development Kit 1.1 installation path (JDK11_PATH) = C:\jdk1.1.7A

Diagnostic error capture level (DIAGLEVEL) = 3
Diagnostic data directory path (DIAGPATH) =

Default database monitor switches
Buffer pool (DFT_MON_BUFPOOL) = OFF
Lock (DFT_MON_LOCK) = OFF
Sort (DFT_MON_SORT) = OFF
Statement (DFT_MON_STMT) = OFF
Table (DFT_MON_TABLE) = OFF
Unit of work (DFT_MON_UOW) = OFF

SYSADM group name (SYSADM_GROUP) =
SYSCTRL group name (SYSCTRL_GROUP) =
SYSMAINT group name (SYSMAINT_GROUP) =

Database manager authentication (AUTHENTICATION) = SERVER
Cataloging allowed without authority (CATALOG_NOAUTH) = NO
Trust all clients (TRUST_ALLCLNTS) = YES
Trusted client authentication (TRUST_CLNTAUTH) = CLIENT

Default database path (DFTDBPATH) = F:

Database monitor heap size (4KB) (MON_HEAP_SZ) = 24
UDF shared memory set size (4KB) (UDF_MEM_SZ) = 256
Java Virtual Machine heap size (4KB) (JAVA_HEAP_SZ) = 512
Audit buffer size (4KB) (AUDIT_BUF_SZ) = 0

Backup buffer default size (4KB) (BACKBUFSZ) = 1024
Restore buffer default size (4KB) (RESTBUFSZ) = 1024

Agent stack size (AGENT_STACK_SZ) = 16
Minimum committed private memory (4KB) (MIN_PRIV_MEM) = 32
Private memory threshold (4KB) (PRIV_MEM_THRESH) = 1296

Sort heap threshold (4KB) (SHEAPTHRES) = 10000

Directory cache support (DIR_CACHE) = YES

Application support layer heap size (4KB) (ASLHEAPSZ) = 15
Max requester I/O block size (bytes) (RQRIOBLK) = 32767
DOS requester I/O block size (bytes) (DOS_RQRIOBLK) = 4096
Query heap size (4KB) (QUERY_HEAP_SZ) = 1000
DRDA services heap size (4KB) (DRDA_HEAP_SZ) = 128

Priority of agents (AGENTPRI) = SYSTEM
Max number of existing agents (MAXAGENTS) = 200
Agent pool size (NUM_POOLAGENTS) = 4 (calculated)
Initial number of agents in pool (NUM_INITAGENTS) = 0
Max number of coordinating agents (MAX_COORDAGENTS) = MAXAGENTS
Max no. of concurrent coordinating agents (MAXCAGENTS) = MAX_COORDAGENTS

Keep DARI process (KEEPDARI) = YES
Max number of DARI processes (MAXDARI) = MAX_COORDAGENTS

Index re-creation time (INDEXREC) = ACCESS

Transaction manager database name (TM_DATABASE) = 1ST_CONN
Transaction resync interval (sec) (RESYNC_INTERVAL) = 180

SPM name (SPM_NAME) =
SPM log size (SPM_LOG_FILE_SZ) = 256
SPM resync agent limit (SPM_MAX_RESYNC) = 20
SPM log path (SPM_LOG_PATH) =

NetBIOS Workstation name (NNAME) = N002A56B

TCP/IP Service name (SVCENAME) = db2cDB2
APPC Transaction program name (TPNAME) =
IPX/SPX File server name (FILESERVER) =
IPX/SPX DB2 server object name (OBJECTNAME) =
IPX/SPX Socket number (IPX_SOCKET) = 879E

Discovery mode (DISCOVER) = SEARCH
Discovery communication protocols (DISCOVER_COMM) = TCPIP
Discover server instance (DISCOVER_INST) = ENABLE

Directory services type (DIR_TYPE) = NONE
Directory path name (DIR_PATH_NAME) =
/.:/subsys/database/
Directory object name (DIR_OBJ_NAME) =
Routing information object name (ROUTE_OBJ_NAME) =
Default client comm. protocols (DFT_CLIENT_COMM) =
Default client adapter number (DFT_CLIENT_ADPT) = 0

Maximum query degree of parallelism (MAX_QUERYDEGREE) = 1
Enable intra-partition parallelism (INTRA_PARALLEL) = NO

No. of int. communication buffers(4KB)(FCM_NUM_BUFFERS) = 1024
Number of FCM request blocks (FCM_NUM_RQB) = 512
Number of FCM connection entries (FCM_NUM_CONNECT) = (FCM_NUM_RQB *
0.75)
Number of FCM message anchors (FCM_NUM_ANCHORS) = (FCM_NUM_RQB *
0.75)


Dan Scott

unread,
Mar 15, 1999, 3:00:00 AM3/15/99
to

Adam Flinton wrote:
>
> Dear All,
>
> I am trying to use a UDF from the Java Samples (the counter sample). I have
> tried just about everything but no luck. When I set the Java Path
> (JDK11_PATH) should it point to the
> classes.zip?

JDK11_PATH should point to the directory that contains the Java
executable. For example, in your case where you have installed the JDK
to C:\jdk1.1.7A, your JDK11_PATH config parm should be set to
C:\jdk1.1.7A\bin.

> As far as I can see Db2 is simply not finding the DB2Udf class file.....

Have you placed the DB2Udf.class file in the right location? I noticed
that you have specified that it should run NOT FENCED; however, you must
still place the class file in the sqllib\function directory, not in the
sqllib\function\unfenced directory. DB2 expects to find any Java UDF or
stored procedure in the sqllib\function directory.



> I have included the dbm cfg just in case anyone can see what's wrong.

By the way, have you tried entering the CREATE FUNCTION command the way
that the client portion of the DB2Udf sample would? That is:

CREATE FUNCTION COUNTER()
RETURNS INT
NOT FENCED
SCRATCHPAD
VARIANT
NO SQL
NO EXTERNAL ACTION


LANGUAGE JAVA
PARAMETER STYLE DB2GENERAL

FINAL CALL
DISALLOW PARALLEL
DBINFO
EXTERNAL NAME 'DB2Udf!ctr'
;

(Note that VARIANT is the equivalent of NOT DETERMINISTIC.) If this
statement doesn't work, it's definitely a pointer to config problems...

Good luck!

Dan

0 new messages