db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kasper, Kay" <kay.kas...@ckc.de>
Subject NullPointerException caused by query
Date Fri, 13 Jul 2007 09:15:13 GMT
Hi,

 

i got an NullPointerException using the test care from below.

 

I'm working with Derby 10.2.2.

 

The problem seems to be caused by the expression f.fkt_name in the
exists-query.

 

I hope that helps to fix the problem.

 

Kay Kasper

 

 

 

error message ----------------------------------

 

Error: java.sql.SQLException: Bei der Auswertung eines Ausdrucks wurde die
Ausnahme 'java.lang.NullPointerException' ausgelöst. SQLSTATE: XJ001:
Java-Ausnahme: ': java.lang.NullPointerException'., SQL State: 38000, Error
Code: -1

Error occured in:

insert into rechte_programm (rp_id, rp_r_id, rp_name, rp_mod_name, rp_typ,
rp_erstellt_um, rp_erstellt_von, rp_geaendert_um, rp_geaendert_von) (select
0 + r.r_id + 1, r.r_id, 'Funktion ' || f.fkt_name, f.fkt_mod_name, 'FKT',
CURRENT_TIMESTAMP, 'SystemBU', CURRENT_TIMESTAMP, 'SystemBU' from
funktionalitaeten f, rechte r where not exists (select 'X' from
rechte_programm rp where rp.rp_r_id = r.r_id and rp.rp_name = 'Funktion ' ||
f.fkt_name))

 

test case ---------------------------------------

 

CREATE TABLE  RECHTE 

(

 R_ID  BIGINT NOT NULL,

 RZ_BEZ_TXT_ID  BIGINT NOT NULL

)

;

CREATE TABLE  RECHTE_PROGRAMM 

(

 RP_ID  BIGINT NOT NULL,

 RP_R_ID  BIGINT NOT NULL,

 RP_NAME  VARCHAR (200) NOT NULL,

 RP_MOD_NAME  VARCHAR (2) NOT NULL,

 RP_TYP  VARCHAR (3) NOT NULL,

 RP_ERSTELLT_UM  TIMESTAMP  NOT NULL,

 RP_ERSTELLT_VON  VARCHAR (20) NOT NULL,

 RP_GEAENDERT_UM  TIMESTAMP  NOT NULL,

 RP_GEAENDERT_VON  VARCHAR (20) NOT NULL

)

;

CREATE TABLE  FUNKTIONALITAETEN 

(

 FKT_NAME  VARCHAR (300) NOT NULL,

 FKT_MOD_NAME  VARCHAR (2) NOT NULL,

 FKT_BEZ_TXT_ID  BIGINT NOT NULL,

 FKT_BESCHR_TXT_ID  BIGINT

)

;

ALTER TABLE  RECHTE 

ADD CONSTRAINT  PK_RECHTE  PRIMARY KEY

(

 R_ID 

)

;

ALTER TABLE  RECHTE 

ADD CONSTRAINT  RECHTE_UK1  UNIQUE

(

 RZ_BEZ_TXT_ID 

)

;

ALTER TABLE  RECHTE_PROGRAMM 

ADD CONSTRAINT  PK_RECHTE_PROGRAMM  PRIMARY KEY

(

 RP_ID 

)

;

ALTER TABLE  RECHTE_PROGRAMM 

ADD CONSTRAINT  RECHTE_PROGRAMM_UK1  UNIQUE

(

 RP_R_ID ,

 RP_NAME ,

 RP_TYP 

)

;

ALTER TABLE  FUNKTIONALITAETEN 

ADD CONSTRAINT  FUNKTIONALITAETEN_PK1  PRIMARY KEY

(

 FKT_NAME 

)

;

ALTER TABLE  RECHTE_PROGRAMM 

ADD CONSTRAINT  RECHTE_PROGRAMM_RECHTE_FK1  FOREIGN KEY

(

 RP_R_ID 

)

REFERENCES  RECHTE 

(

 R_ID 

)

;

insert into rechte (r_id, rz_bez_txt_id) values (0,4)

;

insert into funktionalitaeten (fkt_name, fkt_mod_name, fkt_bez_txt_id,
fkt_beschr_txt_id) values ('wauplus.forms.admin.CALENDAR','DF',2000,2018)

;

insert into rechte_programm (rp_id, rp_r_id, rp_name, rp_mod_name, rp_typ,
rp_erstellt_um, rp_erstellt_von, rp_geaendert_um, rp_geaendert_von) (select
0 + r.r_id + 1, r.r_id, 'Funktion ' || f.fkt_name, f.fkt_mod_name, 'FKT',
CURRENT_TIMESTAMP, 'SystemBU', CURRENT_TIMESTAMP, 'SystemBU' from
funktionalitaeten f, rechte r where not exists (select 'X' from
rechte_programm rp where rp.rp_r_id = r.r_id and rp.rp_name = 'Funktion ' ||
f.fkt_name))

;

drop table rechte_programm

;

drop table funktionalitaeten

;

drop table rechte

;




--------------------------
ckc ag
Sitz:
Industriestr. 10
38110 Braunschweig

Telefon 05307 / 80 20 0
Telefax 05307 / 80 20 444
http://www.ckc.de

Amtsgericht Braunschweig
HRB 5405

Vorstand:
H.-G. Christian Krentel
(Vorsitzender)

Aufsichtsrat:
Dr. Heinz-Werner Weinrich
(Vorsitzender)
Hans Bodenstein
Dr. Rita Schulz
--------------------------



Mime
View raw message