• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to connect J2ME with HSQL ?

 
pingkan paula
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've just download HSQL and DBvisualizer and has run some databases.
I know from this forum that HSQL can connect to MIDP , how is this possible? can anyone show me a little bit tutorial of how to connect an application in MIDP to HSQL ?

cheers
paula
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can only connect to HSQL from a Personal Profile (or PersonalJava) device -- not MIDP. For MIDP databases, check out PointBase.
 
pingkan paula
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks michael.
I've been implementing your code on mobile database from javaworld.com
and i have experience some troubles, the package support which contains
class DBXML parser and SessionConnector can't be applied to package MIDlet.
I'm currently using JBuilderX weblogic and i have download the bundled kxml
from kxml.org and place the it to JBuilderX\j2mewtk2.0\lib.
It seems that the MIDlet package couldn't recognize the package support.*
and i have no idea about it.
Can you tell me the problem?
 
Michael Yuan
author
Ranch Hand
Posts: 1427
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I cannot tell without examining your setup. But in general, it sounds like that you did not put the necessary code and class files into the classpath. I do not use JBuilderX. Sorry cannot help here.
 
pingkan paula
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have compiled the MIDlet programs succesfully, now my problem is in the xml area since i'm new to this protocol.I'm using tomcat 4.1 stand-alone as the web container and i've put the kxml parser jar in common\lib and the kxml classes in common\endorsed.
My question is ,where should i make the xml for the relational database? I've tried to make note.xml in examples\WEB-INF directory but when i run the Session MIDlet it turned out to be Failed.

Here is the sample of note.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE root [
<!ELEMENT root(notes,noteID,userName,noteTime,notes)>
<!ELEMENT noteID (#PCDATA)>
<!ELEMENT userName (#PCDATA)>
<!ELEMENT noteTime (#PCDATA)>
<!ELEMENT notes (#PCDATA)>
]>
<root>
<notes>
<noteID>1</noteID>
<userName>Bill Gates</userName>
<noteTime>2000-00-08 </noteTime>
<notes>good</notes>
</notes>
</root>

that's all ,your help will be fully appreciated

cheers,
paula

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic