This discussion is archived
0 Replies Latest reply: Sep 1, 2009 9:24 AM by 843849 RSS

Prohibited package name: java.sql when Derby classes calls jsr169.jar

843849 Newbie
Currently Being Moderated
I am using Netbeans6.7.1 to develope CDC apllication which runs fine on NetBeans6.7.1 CDC Device Emulator platform tp print "Hello world"

Than, I used XML parsing code in my application and also got success by putting xercesImpl.jar, xml-apis.jar (I should used JSR280...but its just to test XML parsing) library in C:\java\netbeans6.7.1\mobility8\Java_ME_platform_SDK_3.0\runtimes\cdc-hi\lib\ext. My sample program parse XML file correctly.

Now, I want my application to use Derby Embedded database. So, I build JSR169 ( and Derby (

and copied derby.jar, derbytools.jar and jsr169.jar in my Netbeans6.7.1 CDC emulator library C:\java\netbeans6.7.1\mobility8\Java_ME_platform_SDK_3.0\runtimes\cdc-hi\lib\ext

My sample program starts Derby database and displays all information using
But when Derby classes tries to call JSR169.jar, I am getting runtime error as
java.lang.SecurityException: Prohibited package name: java.sql
at java.lang.ClassLoader.defineClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClass(
at java.lang.ClassLoader.loadClassInternal(

googling issue I found two things,
(1) As JSR169.jar is an external library which has "java.sql" package. So java security/policy is not allowing to do this
(2) if compilation java version is higher than running environment java version. Not sure about it because I build jsr169.jar and Derby*.jar in JDK1.5.0_20 and my application source files are compiled with -source 1.5 -target 1.5 and Netbeans6.7.1 inbuilt CDC emulator is using jdk1.4.2_15 (I saw this version in Manifest file of rt.jar in C:\java\netbeans6.7.1\mobility8\Java_ME_platform_SDK_3.0\runtimes\cdc-hi\lib)

Highly appreciate your help
Thanks in advance