Author Topic: Jdbc On Sl6000's Personal Java?  (Read 6839 times)

Tehas

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://users.adelphia.net/~stonerrl/rick/
Jdbc On Sl6000's Personal Java?
« on: February 22, 2005, 12:04:31 am »
I have an app that I wrote for my SL5600 that used SQLite and JDBC.  When I tried running it on my SL6000, I'm getting error that "java.lang.NoClassDefFoundError: java.sql.SQLException".

I did some searching and stumbled upon a guys page who had documented that the Personal Java didn't support JDBC on his 7** or 8** series?  Instead, he had loaded Jeode for his application.

Has anyone gotten JDBC working on the 6000?

Edit:  Just found the link about JDBC not working on a SL750:  https://www.oesf.org/forums/index.php?showtopic=4410&hl=jdbc
« Last Edit: February 22, 2005, 12:06:42 am by Tehas »
+SL-5600 v1.32 ROM (Special pre-emptive kernel with overclock)  +Viking 256CF  +SimpleTech 256CF  +Viking 128SD (as ext2)  +AmbiCom WL1100C +Micro Innovations KB  +Hawking Ethernet CF  
+SL6000L +Lexar 1GB SD (as ext2)  +Windows 98/Me/Nt/XP  +Mandrake 8.1 My Zaurus Page[img]http://users.adelphia.net/~stonerrl/rick/rls_userbar.gif\" border=\"0\" class=\"linked-sig-image\" /]

numeric

  • Newbie
  • *
  • Posts: 9
    • View Profile
Jdbc On Sl6000's Personal Java?
« Reply #1 on: April 20, 2005, 10:27:26 pm »
This is because the required class is not included in J2ME, Personal Profile

This is the work around (a bit dirty), but I can use it to access MySQL on SL-C760

1. locate the personal.jar file (/home/QtPalmtop/j2me/lib)
2. copy this file to PC
3. download jedoe java from caclo feed (http://bryandeluca.com/cacko/feed/jeode_1.10.7-1_arm.ipk)
4. rename the file to jeode_1.10.7-1_arm.ipk.tar.gz so that you can open it with tools like winRAR
5. open the file with a unzip tools, open .\data.tar.gz
6. navigate to "data.tar.gz\.\home\QtPalmtop\lib\"
7. extract core.jar to a temp location
8. open core.jar, locate java\sql
7. extract "sql" folder to a temp folder
8. add the "sql" folder to "personal.jar" (from step 1) under java folder
9. so you get a new lib, backup the orginal one on Zaurus
10. and replace the orginal personal.jar with the new one.
11. try again and see if it is working  

insomniux

  • Newbie
  • *
  • Posts: 15
    • View Profile
Jdbc On Sl6000's Personal Java?
« Reply #2 on: April 24, 2005, 06:34:55 am »
Quote
This is because the required class is not included in J2ME, Personal Profile

This is the work around (a bit dirty), but I can use it to access MySQL on SL-C760

1. locate the personal.jar file (/home/QtPalmtop/j2me/lib)
....
10. and replace the orginal personal.jar with the new one.
11. try again and see if it is working 
[div align=\"right\"][a href=\"index.php?act=findpost&pid=76218\"][{POST_SNAPBACK}][/a][/div]

I've tried this but the error message still comes up. If I open the new personal.jar file on my desktop, it shows the java/sql directory with all files. The personal.jar file in /home/QtPalmtop/j2me/lib is a symlink to /usr/QtPalmtop.rom/j2me/lib, which is a readonly file system. So I removed the symlink and put the new personal.jar on /home/QtPalmtop/j2me/lib.

Might it be that java still looks into /usr/QtPalmtop.rom/j2me/lib, or that the classes in sql are not seen due to version differences? I use the Sharp ROM 1.12.
Is there someone who solved this problem on a sl6000?
Thanks
insomniux
sl-6000 Sharp rom 1.12
Kingston CF-card 1G, Kingston SD-card 512M
GPS Fortuna PocketXTrack
Belt case by Piel Frama

numeric

  • Newbie
  • *
  • Posts: 9
    • View Profile
Jdbc On Sl6000's Personal Java?
« Reply #3 on: April 25, 2005, 09:38:35 pm »
I'm using CACKO 1.22 on SL-C760.

And download & install the j2me runtime from CACKO feed.

Indeed, the personal.jar is not a symlink.

How about use Jeode instead? It provide sql packages.

http://cacko.biz/cacko/feed/jeode_1.10.7-1_arm.ipk

Tehas

  • Full Member
  • ***
  • Posts: 157
    • View Profile
    • http://users.adelphia.net/~stonerrl/rick/
Jdbc On Sl6000's Personal Java?
« Reply #4 on: April 26, 2005, 12:37:34 am »
Thanks, that seemed to work plus I had to do a little tweaking to the instructions on Christoph Kecher's page  http://www.kecher.de/howtos/SQLite-JDBC-Howto.html.

Placing the modified personal.jar in /home/QtPalmtop/j2me/lib, didn't seem to do the trick.  I still got the old error.

Warning:  Mounting your ROM in read-write mode can FUBAR your device!

In order to get the personal.jar file to work, I had to mount the ROM as rw and then copied the modified personal.jar file to /usr/QtPalmtop.rom/j2me/lib/.   I switched the ROM back to ro mode and tested.  This time I got the error "Unable to load sqlite: java.lang.UnsatisfiedLinkError: no sqlite_jni in java.library.path"

I went back to Christoph's page and made some adjustments.  When he tells you to copy the jar and libs to .../jdk1.3/lib..., I instead mounted the ROM as rw and then did symlinks from /usr/QtPalmtop.rom/j2me/lib/ to the location where I store my SQLite-JDBC files (on my SD card).  

So, my /usr/QtPalmtop.rom/j2me/lib/ directory now has:
The modified personal.jar file
Symlink to {my sqlite base on SD}/libsqlite_jni.so.0.0.0 as libsqlite_jni.so
Symlink to {my sqlite base on SD}/sqlite.jar as sqlite.jar

After making these changes, I can now run evm -jar sqlite.jar mytesdb to edit one of my databases.

Thanks for the help!
+SL-5600 v1.32 ROM (Special pre-emptive kernel with overclock)  +Viking 256CF  +SimpleTech 256CF  +Viking 128SD (as ext2)  +AmbiCom WL1100C +Micro Innovations KB  +Hawking Ethernet CF  
+SL6000L +Lexar 1GB SD (as ext2)  +Windows 98/Me/Nt/XP  +Mandrake 8.1 My Zaurus Page[img]http://users.adelphia.net/~stonerrl/rick/rls_userbar.gif\" border=\"0\" class=\"linked-sig-image\" /]

insomniux

  • Newbie
  • *
  • Posts: 15
    • View Profile
Jdbc On Sl6000's Personal Java?
« Reply #5 on: April 26, 2005, 04:13:55 pm »
Quote
Placing the modified personal.jar in /home/QtPalmtop/j2me/lib, didn't seem to do the trick.  I still got the old error.

Warning:  Mounting your ROM in read-write mode can FUBAR your device!

In order to get the personal.jar file to work, I had to mount the ROM as rw and then copied the modified personal.jar file to /usr/QtPalmtop.rom/j2me/lib/.   I switched the ROM back to ro mode and tested.

[div align=\"right\"][a href=\"index.php?act=findpost&pid=76862\"][{POST_SNAPBACK}][/a][/div]

This worked for me on a sl6000 with sharp rom 1.12, to connect to mysql!

insomniux
sl-6000 Sharp rom 1.12
Kingston CF-card 1G, Kingston SD-card 512M
GPS Fortuna PocketXTrack
Belt case by Piel Frama