PL/Java problem.

From: Scott Petersen <scottpetersen(at)softhome(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: PL/Java problem.
Date: 2006-09-06 20:03:25
Message-ID: 44FF298D.3050000@softhome.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Greetings,

Before I start I must admit that I am a newbie to Java. This means that
this might actually be my problem and NOT a software issue, but I need help.

I am attempting to execute the "Hello World" demo from
http://wiki.tada.se/wiki/display/pljava/User+Guide which is part of the
user guide for the software. In the process I created the following
class, and compiled (JAR) with NO errors:

package com.mycompany.helloworld;
public HelloWorld { public String helloWorld() { return
"Hello World"; }
}

Next I ran psql with the following result:

#psql -U mfgadmin mlp204
Password for user mfgadmin:
Welcome to psql 8.1.3, the PostgreSQL interactive terminal.

Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit

Warning: Console code page (437) differs from Windows code page (1252)
8-bit characters may not work correctly. See psql reference
page "Notes for Windows users" for details.

mlp204=# select sqlj.install_jar('file:///Java source/helloworld.jar',
'hellowor
ld_jar', false);
install_jar
-------------

(1 row)

mlp204=# select sqlj.set_classpath('public', 'helloworld_jar');
set_classpath
---------------

(1 row)

mlp204=# CREATE OR REPLACE FUNCTION helloworld()
mlp204-# RETURNS "varchar" AS
mlp204-# 'com.mycompany.helloworld.HelloWorld.helloWorld'
mlp204-# LANGUAGE 'java' VOLATILE;
CREATE FUNCTION
mlp204=# select * from helloworld();
ERROR: java.lang.ClassNotFoundException:
com.mycompany.helloworld.HelloWorld
mlp204=#

Everything seems to be working fine except I receive a
"ClassNotFoundException". Any help in understanding what I did wrong
would be appreciated.

Thanks Scott.

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Oliver Jowett 2006-09-06 20:12:09 Re: scollable result sets
Previous Message Dave Cramer 2006-09-06 17:49:23 Re: upgrade problem with driver postgresql-8.1-407.jdbc3.jar