Skip to main content

JSR 169 / JDBC Op API

10 replies [Last post]
mnirhali
Offline
Joined: 2004-03-04

A big thanks to everyone involved in bringing CDC platform to the community.

Long back, reference implementation for JDBC Optional package was released (JSR 169). It would have been nice to see that in the MR2 released recently. There has been lot of lightweight DB engines coming up lately and that API provides basic support on CDC platform ??

Is there a way to get the jar file for JSR169 to work with MR2 ??
Is there any plan to include that in future releases of phoneME advanced ??

Thanks
Mayuresh

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pragun
Offline
Joined: 2009-02-13

I used Netbeans6.7.1 (inbuilt JavaME3.0) to develope CDC apllication which runs fine on NetBeans6.7.1 CDC Device Emulator platform.

I have JSR169 build (http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation) and Derby build (http://svn.apache.org/viewvc/db/derby/code/trunk/BUILDING.html?view=co)

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 org.apache.derby.tools.sysinfo
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(ClassLoader.java:588)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:143)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:282)
at java.net.URLClassLoader.access$100(URLClassLoader.java:75)
at java.net.URLClassLoader$1.run(URLClassLoader.java:222)
at java.security.AccessController.doPrivileged(AccessController.java:351)
at java.net.URLClassLoader.findClass(URLClassLoader.java:208)
at java.lang.ClassLoader.loadClass(ClassLoader.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:291)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:365)

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)

any help highly appreciated
thanks in advance

pallen_fgcu
Offline
Joined: 2009-02-13

I'm not the best at this, but I am building my own phoneME Advanced MR2 CDC for win32 ARM and have included JSR169 in my build, but I have also implemented Lumberjack which adds the java.util.logging api to my cvm and faced a similar security exception on package java.util, but was able to get around this by adding the logging.jar file the lib folder and to my boot classpath "-Xbootclasspath/a:\Program Files\phoneMe\lib\logging.jar" and this solved the issue.

Not sure if this will work the same but you might try it.

arun8989
Offline
Joined: 2009-03-17

Hi Mayuresh,

Great post dude! I m working on CDC toolkit(CDCTK10) and I am trying to establish a connection with MySQL database on Windows platform during this I am facing a problem while building a JAR of Optional Package (jdbc_cdc1.0).

Do you have any idea how to build a JAR from Optional Package? Any help would be highly appreciated.

Thanks in advance.

- Arun Mehta & Anil Soni

arodriguezvivas
Offline
Joined: 2009-07-07

I have exactly the same problem. Hope you have already a solution, if dont, I´l tell you my news.

arodriguezvivas
Offline
Joined: 2009-07-07

I tried the Chris tutorial but always I get this message: "perl" no se reconoce como un comando interno o externo. That means "perl" is not recongnized like a intern or extern comand.

Any idea how to solve it?

cjplummer
Offline
Joined: 2006-10-16

JDBC and RMI were originally designed to overlay on top of cdc and then built using OPT_PKGS=jdbc,rmi. This isn't such a good approach when cdc is an svn component.

I've created a twiki with instructions for building jdbc and rmi as seperate components rather than as overlays. Some modifications of cdc/build/share/defs_op.mk are needed to accomplish this. Perhaps they can be committed to MR2.

http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvancedBuildingJ...

Chris

Hinkmond Wong

Hi Mayuresh! (Good to hear from you!)

phonemeadvanced@mobileandembedded.org wrote:
> A big thanks to everyone involved in bringing CDC platform to the community.
>
> Long back, reference implementation for JDBC Optional package was released (JSR 169). It would have been nice to see that in the MR2 released recently. There has been lot of lightweight DB engines coming up lately and that API provides basic support on CDC platform ??
>
> Is there a way to get the jar file for JSR169 to work with MR2 ??
> Is there any plan to include that in future releases of phoneME advanced ??
>

I'm not aware of any specific plans for JSR 169 anytime soon with
phoneME Advanced, but since phoneME Advance MR2 is open source, if you
want to experiment with it, you should be able to get the RI for JSR 169
from here and do some research yourself:

http://java.sun.com/products/jdbc/download.html#cdcfp

JSR 169 is just a set of interfaces that you hook up to your specific
DB, so you should do the port yourself without any problem and in a
short amount of time.

Let us all know how your port works for you. We'd love to hear how it
goes and how much work is involved and if you share that info with the
community that will help the open source effort.

Best regards,
Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

mnirhali
Offline
Joined: 2004-03-04

Thanks hinkmond for your response.

I tried building from the jsr169 source bundle, but the make files are not complete.
I instead used my own way of building it and have documented the steps here,

http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation

After successful building, I tried running JavaDB on this CDC/JDBCOp platform and I am happy to tell you that I was able to connect properly to the database. I am planning to document the steps for that soon.

I have some concerns with JDBC Op package though. It is compliant with JDBC 2.0 spec. Things have moved on a lot since that package was released back in 2004. JDBC 4.0 is out with JDK6. It will be good if new specifications are supported by this Op pack.

Thanks
Mayuresh

Hinkmond Wong

phonemeadvanced@mobileandembedded.org wrote:
> Thanks hinkmond for your response.
>
> I tried building from the jsr169 source bundle, but the make files are not complete.
> I instead used my own way of building it and have documented the steps here,
>
> http://blogs.sun.com/wittyman/entry/building_jdbc_for_cdc_foundation
>
> After successful building, I tried running JavaDB on this CDC/JDBCOp platform and I am happy to tell you that I was able to connect properly to the database. I am planning to document the steps for that soon.
>
> I have some concerns with JDBC Op package though. It is compliant with JDBC 2.0 spec. Things have moved on a lot since that package was released back in 2004. JDBC 4.0 is out with JDK6. It will be good if new specifications are supported by this Op pack.

The building instructions and suggestions for JDBC on Java ME would be
good as TWiki pages also. If you have the chance, please feel free to
add your content to new TWiki pages on this subject at:

http://wiki.java.net/bin/view/Mobileandembedded/PhoneMEAdvanced

Thanks,
Hinkmond

---------------------------------------------------------------------
To unsubscribe, e-mail: advanced-unsubscribe@phoneme.dev.java.net
For additional commands, e-mail: advanced-help@phoneme.dev.java.net

arun8989
Offline
Joined: 2009-03-17

I downloaded and compiled optional package (JSR-169).When I add this jar to my NetBeans project because I will have an exception:
java.lang.SecurityException: Prohibited package name: java.sql
at sun.misc.Launcher$AppClassLoader.handlePackage(Launcher.java:472)
at sun.misc.Launcher$AppClassLoader.defineClassPrivate(Launcher.java:516)
at sun.misc.Launcher$AppClassLoader.access$500(Launcher.java:325)
at sun.misc.Launcher$4.run(Launcher.java:546)

I add this jar to my emulator and I have an exception:
java.lang.NoClassDefFoundError: java.sql.SQLException
at java.lang.Class.getMethod0(Native Method)
at java.lang.Class.getMethod(Class.java:958)
at sun.misc.CVM.runMain(CVM.java:460).

What should I do to add this jar to my netbeans project?

Any help would be highly appreciated. Thanks in advance!!!