db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Db-derby Wiki] Update of "JavaMESupport" by JohnHEmbretsen
Date Tue, 27 Nov 2007 11:13:07 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Db-derby Wiki" for change notification.

The following page has been changed by JohnHEmbretsen:
http://wiki.apache.org/db-derby/JavaMESupport

The comment on the change is:
Various improvements, added ij info

------------------------------------------------------------------------------
  
  This page describes Derby's support for [http://java.sun.com/javame/index.jsp Java ME] (also
known as J2ME) environments, provides hints about how to use Derby in such environments, and
links to more information.
  
- [[TableOfContents]]
+ [[TableOfContents(3)]]
  
+ [[Anchor(requirements)]]
  == Requirements ==
  You can run Derby on a small device (such as a PDA or cell phone) which supports a Java
ME environment with the following minimum specifications:
   * Connected Device Configuration (CDC) 1.1
   * Foundation Profile (FP) 1.1
   * JSR 169: JDBC Optional Package for CDC/Foundation Profile
  
- If your Derby version is older than version 10.1.1.0, Java ME is not supported at all. If
you have a version of Derby that is newer than 10.1.1.0, but older than 10.3.1.4, CDC/FP 1.0
is also supported. Note that there are some limitations imposed on Derby when run on a Java
ME platform, see the  [#dosc documentation] for details.
+ If your Derby version is older than version 10.1.1.0, Java ME is not supported at all. If
you have a version of Derby that is 10.1.1.0 or newer, but older than 10.3.1.4, CDC/FP 1.0
is also supported. Note that there are some limitations imposed on Derby when run on a Java
ME platform, see the  [#docs documentation] for details.
  
  The fact that Derby supports the Foundation Profile means that other CDC profiles that are
supersets of FP, for example the Personal Basis Profile (PBP), are also supported.
  
@@ -24, +25 @@

  == Documentation, Specifications and APIs ==
  
  Derby's Java ME support is documented in...
-  * the Jira issue tracking the initial implementation of CDC support in Derby: [http://issues.apache.org/jira/browse/DERBY-97
DERBY-97]
+  * the Jira issue tracking the initial implementation of CDC support in Derby: [http://issues.apache.org/jira/browse/DERBY-97
DERBY-97] (this includes a functional specification)
   * the Reference Guide: [http://db.apache.org/derby/docs/dev/ref/rrefjdbcjsr169.html JDBC
Package for Connected Device Configuration/Foundation Profile (JSR169)]
   * the Tools and Utilities Guide: [http://db.apache.org/derby/docs/dev/tools/rtoolsijproprefdatasource.html
ij.dataSource property]
   * the published API: [http://db.apache.org/derby/javadoc/publishedapi/jdbc3/org/apache/derby/jdbc/EmbeddedSimpleDataSource.html
EmbeddedSimpleDataSource]
@@ -39, +40 @@

  
  == How to use Derby with a Java ME VM ==
  
- JDBC for Java ME (JSR-169) does not include the {{{java.sql.Driver}}} or {{{java.sql.DriverManager}}}.
This means that you have to use the {{{javax.sql.DataSource}}} interface for accessing a Derby
database. Derby ({{{derby.jar}}}) includes a !DataSource implementation for Java ME environments:
[http://db.apache.org/derby/javadoc/publishedapi/jdbc3/org/apache/derby/jdbc/EmbeddedSimpleDataSource.html
EmbeddedSimpleDataSource]. Derby does not include client/server support for Java ME environments
(yet).
+ JDBC for Java ME (JSR-169) does not include {{{java.sql.Driver}}} or {{{java.sql.DriverManager}}}.
This means that you have to use an implementation of the {{{javax.sql.DataSource}}} interface
for accessing a Derby database on a Java ME platform. Derby ({{{derby.jar}}}) includes a !DataSource
implementation for Java ME environments: [http://db.apache.org/derby/javadoc/publishedapi/jdbc3/org/apache/derby/jdbc/EmbeddedSimpleDataSource.html
EmbeddedSimpleDataSource]. Derby does not include client/server support for Java ME environments
(yet).
  
- Derby 10.3.2 and newer include a sample application showing how to create and access a database
in a Java ME environment: {{{SimpleMobileApp}}}. This application is available in the {{{demo/programs/simplemobile}}}
directory of Derby -bin installations. You can also view the source code from Derby's Subversion
repository [http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/simplemobile/SimpleMobileApp.java?view=markup
here].
+ Derby databases are portable between Java ME and Java SE platforms, provided that databases
created or modified on a Java SE platform do not use features that are not supported by Derby
in a Java ME environment (such as database encryption or server-side procedures).
  
- Derby databases are portable between Java ME and Java SE platforms, provided that databases
created or modified on a Java SE platform do not use features that are not supported by Derby
in a Java ME environment (such as encrypted databases or server-side procedures).
+ === Using Derby in Java ME applications ===
+ Derby 10.3.2 and newer include a sample application showing how to create and access a database
in a Java ME environment: {{{SimpleMobileApp}}}. This application is available in the {{{demo/programs/simplemobile}}}
directory of Derby -bin installations. You can also [http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/simplemobile/SimpleMobileApp.java?view=markup
view the latest SimpleMobileApp source code] from Derby's Subversion repository.
  
  === Using ij with a Java ME VM ===
  
- Details to come...
+ {{{ij}}} is Derby's command line tool for accessing databases using JDBC. By default, {{{ij}}}
uses the {{{DriverManager}}} mechanism to establish connections, which won't work in a Java
ME environment. To use a {{{DataSource}}} instead, specify the [http://db.apache.org/derby/docs/dev/tools/rtoolsijproprefdatasource.html
ij.dataSource property] when starting {{{ij}}}. In a Java ME environment this property must
specify {{{org.apache.derby.jdbc.EmbeddedSimpleDataSource}}}.
+ 
+ To avoid errors on {{{ij}}} startup , you most likely have to include the {{{ij.dataSource.databaseName}}}
property as well, specifying a database name, and {{{ij.dataSource.createDatabase=create}}}
if the database does not already exist.
+ 
+ You can specify {{{ij}}} properties on the command line when starting {{{ij}}} (using {{{-D<property>=<value>}}}),
or in a properties file and then use {{{ij}}}'s {{{-p}}} option at startup. ''Property names
are case sensitive.'''
+ 
+ Example property file, {{{ij.properties}}}:
+ {{{
+ ij.dataSource=org.apache.derby.jdbc.EmbeddedSimpleDataSource
+ ij.dataSource.databaseName=sample
+ ij.dataSource.createDatabase=create
+ }}}
+ 
+ Example startup of {{{ij}}} using phoneME Advanced with built-in JSR-169 support, on Linux:
+ {{{
+ > $CDC_HOME/bin/cvm -jar $DERBY_HOME/lib/derbyrun.jar ij -p ij.properties
+ }}}
+ 
  
  == Java ME VMs tested with Derby ==
  
@@ -65, +84 @@

  
  == Java ME Tips and tricks ==
  
+ If you see a problem that you don't know how to solve, post a question on the derby-user
[http://db.apache.org/derby/derby_mail.html mailing list].
+ 
+ You may also find useful information in previous mailing list topics by searching the archives,
for example [http://www.nabble.com/forum/Search.jtp?query=CDC&local=y&page=1&forum=93&daterange=0
Nabble].
+ 
+ Some specific hints are included below (feel free to add more).
+ 
+ ==== Out of Memory ====
  If you are running Derby on a resource-constrained device and frequently run out of memory,
the following tips may help:
   * increase the amount of memory available to the VM, if possible (for example, some VMs
support the {{{-Xmx}}} option)
-  * tune Derby's page cache ([http://www.nabble.com/Out-of-Memory-t1620472.html#a4396940
explained here])
+  * tune Derby's page cache (for example as [http://www.nabble.com/Out-of-Memory-t1620472.html#a4396940
explained here])
  
- If the VM you are using has never been tested against Derby, you may run into new issues,
such as Derby not properly recognizing your VM as a Java ME (JSR-169) environment. If you
see a problem that you don't know how to solve, post a question on the derby-user [http://db.apache.org/derby/derby_mail.html
mailing list].
+ ==== VM not recognized as Java ME ====
+ If the VM you are using has never been tested against Derby, you may run into new issues,
such as Derby not properly recognizing your VM as a Java ME (JSR-169) environment. An indication
of this may be that Derby is trying to use a class or interface that is not available on a
Java ME platform, e.g. {{{java.sql.Driver}}}.
  
- You may also find useful information in previous mailing list topics by searching the archives,
for example [http://www.nabble.com/forum/Search.jtp?query=CDC&local=y&page=1&forum=93&daterange=0
Nabble].
-    
+ To see which Java and JDBC version Derby tries to conform with in your environment, run
the {{{sysinfo}}} tool and inspect the information under the following line:
+ {{{
+ --------- Derby Information --------
+ }}}
+ It should include "J2ME" or "Java ME" and "CDC", something like this:
+ {{{
+ --------- Derby Information --------
+ JRE - JDBC: J2ME - JDBC for CDC/FP 1.1
+ }}}
+ See VersionInfo for more information.
  
+ If you meet all the [#requirements requirements] and think you are seeing this problem,
report it on the {{{derby-user}}} or {{{derby-dev}}} mailing list.
+ 

Mime
View raw message